sending php variable hidden form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Josh_Dude83
Forum Newbie
Posts: 10
Joined: Mon Jul 12, 2010 11:15 am

sending php variable hidden form

Post 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>	
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: sending php variable hidden form

Post by AbraCadaver »

Code: Select all

<?php echo $id;?>
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Josh_Dude83
Forum Newbie
Posts: 10
Joined: Mon Jul 12, 2010 11:15 am

Re: sending php variable hidden form

Post 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.
Post Reply