FORMS, hidden element and passing data to next page...

From: Date: Tue, 22 Apr 2003 03:57:58 +0000
Subject: FORMS, hidden element and passing data to next page...
Groups: php.windows 
Request: Send a blank email to php-windows+get-19542@lists.php.net to get a copy of this message
okay, making a simple form but i wanna pass more than the data being selected from the dropdown/select FORM element. for example: // TEST1.PHP // mysql connections code and stuff taken out. it works... echo ('<FORM ACTION="test2.php" METHOD=POST>'); echo ('<SELECT NAME="user_id">'); while ($res = mysql_fetch_row ($result)) { echo ('<OPTION VALUE='.$res[0].'>'.$res[1].', .$res[2]); } mysql_close ($link_id); echo (' </SELECT></P>'); echo ('<INPUT TYPE=hidden NAME="first_name" VALUE='.$res[2].'>'); echo ('<INPUT TYPE=submit NAME=Submit VALUE="Submit">'); $res[0] = id key of user $res[1] = lastname $res[2] = firstname // TEST2.PHP echo ('user id: '.$_POST[user_id]); echo ('first name: '.$_POST[first_name]); "user_id" comes out fine. but the "first_name" doesnt. am i using the HIDDEN form type correctly? i guess i dont want to access the DB again on TEST2.PHP. after all, in TEST1.PHP, i build the SELECT form element from the DB. or is this the only way? the HIDDEN element doesnt or cant receive the data correctly? thanks... -- Leo G. Divinagracia III ldivinag@csuhayward.edu zzzzz

« previous php.windows (#19542) next »