RE: [PHP] Switch Form
| From: | Jay Blanchard | Date: | Tue, 01 Feb 2005 20:14:08 +0000 |
| Subject: | RE: [PHP] Switch Form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207854@lists.php.net to get a copy of this message | ||
[snip]
Hi list,I have 2 forms :
<form name='form1' action='page.php' method='Post'>
</form>
<form name='form2' action='page.php method='Post''>
</form>
Now, in page.php is possible to do a switch of form name? Something like
this :
Switch ($_POST['form'] {
'form1' : ...
'form2' : ...
}
If this is possible,i dont know how to call it, can you help me please?
[/snip]
Do this...
<form name='form1' action='page.php' method='Post'>
<input type='submit' name='action' value='Button 1'>
</form>
<form name='form2' action='page.php method='Post''>
<input type='submit' name='action' value='Button 2'>
</form>
switch ($_POST['action]){
case "Button 1":
...stuff...
break;
case "Button 2";
...stuff...
break;
}