Form and menu ???

liunx

Guest
First of all user will be asked how many time? suppose 'n' times.<br />
<br />
Then user can select one item from a menu. then hit Submit button. Data will be stored. Then it will show the menu again and user will select one. this process will be executed n times. <br />
<br />
How to do this in one single page (without opening another page)<!--content-->excuse me? Hold on what exactly are you trying to do, have a user select someting from a menu or two and store the data but have this all on one page?.... Ok I read it over I understand it. But can a write code for it off the top of my head? NOPE! But it is going to be java script I can tell you that much.<!--content-->Thank you for your suggestion. But I think I could not make myself clear to you. I am going to tell you indetail about my plan or goal. <br />
<br />
First of all user will be asked a number of rows. Suppose user choose 3. And then the memu will be appear onece and user will select one or more item from that menu and hit submit. Those items will be stored in one row of mysql data base table. Then the same menu will be apeared to the screen second time and user will do the same and it will go for 3rd time as user chose the number 3 at the begining.After that I will use those items for my next operation. Let me know if you understand my problem. Some code for the necessary steps will be appriciated. Thank you.<!--content-->The alarm went off right when I saw stored and mysql together. Looks like you need some php. I would help but... I am not a php man... Not my technology of choice.<!--content-->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. <br />
<br />
<br />
<br />
<br />
<?php <br />
if($submit != "submit" || $submit != "send") <br />
{ <br />
print "<form action=\"index.php\" method=\"GET\">"; <br />
print "<p>Enter in the number of times below:</p>"; <br />
print "<input type=\"text\" name=\"number\" size=\"30\">"; <br />
<br />
print "<input name=\"submit\" type=\"submit\" value=\"send\">"; <br />
print "<input name=\"reset\" type=\"reset\" value=\"reset\">"; <br />
print "</form>"; <br />
} <br />
if ($submit == "send") <br />
{ <br />
<br />
$main_count = 1; <br />
$months = array("January","February","March","April","May","June","July", <br />
"August","September","October","November","December"); <br />
$number = $HTTP_GET_VARS["number"]; <br />
print "<form action=\"index.php\" method=\"GET\">"; <br />
while($main_count <= $number) <br />
{ <br />
print "<select name=\"something\" value=\"$main_count\" multiple"; <br />
for ($x_f=0; $x_f<=count($months); $x_f++) <br />
{ <br />
print "\t<option value=\"$x_f\">".$months[$x_f-1]."\n"; <br />
reset($months); <br />
} <br />
print "</select>"; <br />
print "<br>"; <br />
$main_count++; <br />
} <br />
print "<input name=\"submit\" type=\"submit\" value=\"submit\">"; <br />
print "<input name=\"reset\" type=\"reset\" value=\"reset\">"; <br />
print "</form>"; <br />
} <br />
if ($submit == "submit") <br />
{ <br />
//you insert all of the data from the form element into the DB here <br />
//make sure to use $HTTP_GET_VARS[""]; for you variables <br />
print "Hello World"; <br />
} <br />
?><!--content-->
 
Back
Top