szms
Mon 11th Aug '03, 11:03am
Please take a llok of my code. after hitting the second submit button it supposed to show me "You choosed ................"
Please help me with this code.
<?php
$Function_Name[] = "foo";
$Function_Name[] = "bar";
$Function_Name[] = "foobar";
$Function_Name[] = "barfoo";
$Function_Name[] = "kittythrow";
?>
<pre>
<form method="POST">
<b>How many times you want</b>
<input type="text" name="number" Size = "30">
<?php
if(isset($_POST['submit'])) {
?>
<b>Select any of the following Function</b>
<?php
for ($i=0; $i<$_POST['number']; $i++) {
echo '<select name="FunctionMenu'.$i.'">';
foreach ($Function_Name as $Existing_Function) {
echo "<option value=\"$Existing_Function \">$Existing_Function</option>";
}
echo "</select>\n";
}
}
?>
<input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="Reset">
</form>
<?php
if(isset($_POST['FunctionMenu'])) {
echo 'You choosed '.$_POST['FunctionMenu'].'!';
}
?>
Please help me with this code.
<?php
$Function_Name[] = "foo";
$Function_Name[] = "bar";
$Function_Name[] = "foobar";
$Function_Name[] = "barfoo";
$Function_Name[] = "kittythrow";
?>
<pre>
<form method="POST">
<b>How many times you want</b>
<input type="text" name="number" Size = "30">
<?php
if(isset($_POST['submit'])) {
?>
<b>Select any of the following Function</b>
<?php
for ($i=0; $i<$_POST['number']; $i++) {
echo '<select name="FunctionMenu'.$i.'">';
foreach ($Function_Name as $Existing_Function) {
echo "<option value=\"$Existing_Function \">$Existing_Function</option>";
}
echo "</select>\n";
}
}
?>
<input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="Reset">
</form>
<?php
if(isset($_POST['FunctionMenu'])) {
echo 'You choosed '.$_POST['FunctionMenu'].'!';
}
?>