I tried the following code but I am not getting the output that I am looking for. I want one menu at a time and after pressing the submit button another menu (same one) will be appeared in the same place if user choose 2 as number. Plese give me some suggestion.
<?php
if($submit != "submit" || $submit != "send")
{
print "<form action=\"index.php\" method=\"GET\">";
print "<p>Enter in the number of times below:</p>";
print "<input type=\"text\" name=\"number\" size=\"30\">";
print "<input name=\"submit\" type=\"submit\" value=\"send\">";
print "<input name=\"reset\" type=\"reset\" value=\"reset\">";
print "</form>";
}
if ($submit == "send")
{
$main_count = 1;
$months = array("January","February","March","April","May","June","July",
"August","September","October","November","December");
$number = $HTTP_GET_VARS["number"];
print "<form action=\"index.php\" method=\"GET\">";
while($main_count <= $number)
{
print "<select name=\"something\" value=\"$main_count\" multiple";
for ($x_f=0; $x_f<=count($months); $x_f++)
{
print "\t<option value=\"$x_f\">".$months[$x_f-1]."\n";
reset($months);
}
print "</select>";
print "<br>";
$main_count++;
}
print "<input name=\"submit\" type=\"submit\" value=\"submit\">";
print "<input name=\"reset\" type=\"reset\" value=\"reset\">";
print "</form>";
}
if ($submit == "submit")
{
//you insert all of the data from the form element into the DB here
//make sure to use $HTTP_GET_VARS[""]; for you variables
print "Hello World";
}
?>