A
Anonymous
Guest
How to pass a value from one page to another? As below, if I using a pull down menu and I choose ‘Subject2’. If i click submit button, all values were sent to another page. How do I pass only the ‘Subject2’ values to another page??
something wrong with this code? how can i improve it?
[Edited by Swirlee because it was breaking the forum layout.]
something wrong with this code? how can i improve it?
Code:
<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select * from student where username1 = '$username1'");
$number_of_array = mysql_num_rows($result);
print"<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"1\">";
print "<TR><TD>Student ID</TD><TD>Programme</TD><TDSubject</TD><TD>Action</TD></TR>\n";
while ($number_of_array = mysql_fetch_array($result))
{
echo "<tr>\n";
echo "<TD>$number_of_array[username1]</TD>\n";
echo "<TD>$number_of_array[programme]</TD>\n";
echo "<TD><select name=\"subject\"><option value=subject>$number_of_array[subject1]
</option><option value=subject>$number_of_array[subject2]</option><option
value=subject>$number_of_array[subject3]</option><option value=subject>
$number_of_array[subject4]</option><option value=subject>$number_of_array[subject5]
</option></select></TD>\n";
echo "<td><form name=\"main\" method=\"post\" action=\"verify_attendance.php?
username1=$number_of_array[username1]&subject=$number_of_array[subject1]
$number_of_array[subject2]$number_of_array[subject3]$number_of_array[subject4]
$number_of_array[subject5]&programme=$number_of_array[programme]\"><input
type=\"submit\" name=\"Submit\" value=\"Submit\"></form></td>";
echo "</tr>\n";
}
?>
[Edited by Swirlee because it was breaking the forum layout.]