i am having trouble getting information from one form to another form. I am trying to use a drop down menu with values from a database and once one is selected the value is used in an argument on the next from. I have tried printing the value to the screen in the next form but it comes up blank. I have other forms that exchange data so i think the problem is with my loop. The text fro which is below:
$display_block = "<h1>Select Course</h1>";
//get parts of records
$get_list = "select ctitle as display_name from course";
$get_list_res = mysql_query($get_list) or die(mysql_error());
if (mysql_num_rows($get_list_res) < 1) {
//no records
$display_block .= "<p><em>Sorry, no records to select!</em></p>";
} else {
$display_block .= "
<form method=\"post\" action=\"insert_attend2.php\">
<P><strong>Select a Course:</strong><br>
<select name=\"sel_id\">
<option value=\"\">-- Select One --</option>";
while ($recs = mysql_fetch_array($get_list_res)) {
$id = $recs['ctitle'];
$display_name = stripslashes($recs['display_name']);
$display_block .= "<option value=\"$id\">
$display_name</option>";
}
$display_block .= "
</select>
<p><input type=\"submit\" name=\"submit\" value=\"Select\"></p>
</FORM>";
}
Could anyon please tell me how i would call for the value selected in the next form as i have tried everything i can think of.
Many thanks
$display_block = "<h1>Select Course</h1>";
//get parts of records
$get_list = "select ctitle as display_name from course";
$get_list_res = mysql_query($get_list) or die(mysql_error());
if (mysql_num_rows($get_list_res) < 1) {
//no records
$display_block .= "<p><em>Sorry, no records to select!</em></p>";
} else {
$display_block .= "
<form method=\"post\" action=\"insert_attend2.php\">
<P><strong>Select a Course:</strong><br>
<select name=\"sel_id\">
<option value=\"\">-- Select One --</option>";
while ($recs = mysql_fetch_array($get_list_res)) {
$id = $recs['ctitle'];
$display_name = stripslashes($recs['display_name']);
$display_block .= "<option value=\"$id\">
$display_name</option>";
}
$display_block .= "
</select>
<p><input type=\"submit\" name=\"submit\" value=\"Select\"></p>
</FORM>";
}
Could anyon please tell me how i would call for the value selected in the next form as i have tried everything i can think of.
Many thanks