Hidden Value not passing- basic noob
Posted: Wed Jul 13, 2005 10:58 am
hello everyone-
this seems like an easy problem, however I couldn't find a solution when doing any searches, so I apologize for repeating if this has been answered before. Basically, I am putting mysql data into a table, then trying to pass a value in a hidden field from one php file to another, and it's not going through. Here's page one's code (I cut out a lot obviously):
<?PHP
$result = mysql_query("SELECT * FROM eventtable")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<tr><td>";
echo $row['eventname'];
echo "</td><td>";
echo "<br>" ;
echo "<form method='post' action='page2.php'><input name='eventnamemodify' type='hidden' value='<?PHP echo {$row['eventname']} ?>' /> <input type='submit' name='submit' value='modify' /></form>";
echo "<br>" ;
echo "</td></tr>";
?>
-----
AND HERE IS PAGE2'S CODE
<?PHP
$eventnamemodify = $_REQUEST['eventnamemodify'] ;
echo $eventnamemodify ;
?>
and nothing prints out.
Thanks for the help in advance.
this seems like an easy problem, however I couldn't find a solution when doing any searches, so I apologize for repeating if this has been answered before. Basically, I am putting mysql data into a table, then trying to pass a value in a hidden field from one php file to another, and it's not going through. Here's page one's code (I cut out a lot obviously):
<?PHP
$result = mysql_query("SELECT * FROM eventtable")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<tr><td>";
echo $row['eventname'];
echo "</td><td>";
echo "<br>" ;
echo "<form method='post' action='page2.php'><input name='eventnamemodify' type='hidden' value='<?PHP echo {$row['eventname']} ?>' /> <input type='submit' name='submit' value='modify' /></form>";
echo "<br>" ;
echo "</td></tr>";
?>
-----
AND HERE IS PAGE2'S CODE
<?PHP
$eventnamemodify = $_REQUEST['eventnamemodify'] ;
echo $eventnamemodify ;
?>
and nothing prints out.
Thanks for the help in advance.