RE: [PHP] Multiple submit's on one form
| From: | César Aracena | Date: | Wed, 07 Aug 2002 17:06:43 +0000 |
| Subject: | RE: [PHP] Multiple submit's on one form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111540@lists.php.net to get a copy of this message | ||
You can use with more ease the switch() function:
http://www.php.net/manual/en/control-structures.switch.php
HTH, C.
> -----Original Message-----
> From: Adam Plocher [mailto:aplocher@erepublic.com]
> Sent: Wednesday, August 07, 2002 2:05 PM
> To: 'Saci'
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] Multiple submit's on one form
>
> Probably the best way would be to have it submitted to only one PHP
page
> then have that page forward you.
>
> Example:
>
> If ($B1 == "Save")
> Header("Location: http://www.url.com");
> Elseif ($B2 == "Back")
> Header("Location: http://www.url2.com");
>
> .. Etc ..
>
> To have the variables passed from the form to those pages you could
use
> GET
> vars or something.
>
> Hope this helps..
>
> -Adam
>
> -----Original Message-----
> From: Saci [mailto:nospam@bol.com.br]
> Sent: Wednesday, August 07, 2002 9:51 AM
> To: php-general@lists.php.net
> Subject: [PHP] Multiple submit's on one form
>
>
> I have a form working well and I need 4 different submit buttons,
> something
> like this
>
>
>
> <form method="POST" action=myphpcode.php>
>
> <table border="0" cellpadding="1" bgcolor="#E0DFE3">
>
> ...
>
> ..
>
> ..
>
> ..
>
> ..
>
>
>
> <tr>
>
> <td bgcolor="#E0DFE3">
>
> <input type="submit" value="Save" name="B1"></td>
>
> <td bgcolor="#E0DFE3">
>
> <input type="submit" value="Back" name="B2"></td>
>
> <td bgcolor="#E0DFE3">
>
> <input type="submit" value="Refresh"
> name="B3"></td>
>
> <td bgcolor="#E0DFE3">
>
> <input type="submit" value="Search"
> name="B4"></td>
>
> </tr>
>
> </table>
>
> </form>
>
> </body>
>
> </html>
>
>
>
>
>
> I would like to call 4 different php pages according to the one of the
4
> buttons pressed.
>
>
>
> Button B1 will post to myphpcode1.php
>
> Button B2 will post to myphpcode2.php
>
> Button B3 will post to myphpcode3.php
>
> Button B4 will post to myphpcode4.php
>
>
>
> How can I define that since the form has only one post method?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php