Page 1 of 1

sending php variable hidden form

Posted: Wed Jul 14, 2010 1:28 pm
by Josh_Dude83
I've been at this for over an hour and it's not posting the hidden input:

Code: Select all


$id = "test";

<form action="edit.php" method="post" onsubmit="return validateForm(this)">
			    Title: <input type="text" name="title"><br />
			    Author: <input type="text" name="author"><br />
			    Subject: <input type="text" name="subject"><br />
			    <input type="hidden" name="id" value="<?php $id;?>">//what is the correct syntax
			    <input type="submit" value="Submit">
			    </form>	

Re: sending php variable hidden form

Posted: Wed Jul 14, 2010 1:41 pm
by AbraCadaver

Code: Select all

<?php echo $id;?>

Re: sending php variable hidden form

Posted: Wed Jul 14, 2010 1:59 pm
by Josh_Dude83
wow thanks a lot for the quick reply. I had tried this:

<?php echo $id?>

and this:

<?php $id;?>

but never your solution.