Re: One Form, Two Actions
| From: | Teodor Cimpoesu | Date: | Thu, 23 Nov 2000 09:42:20 +0000 |
| Subject: | Re: One Form, Two Actions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26808@lists.php.net to get a copy of this message | ||
Hi Juergen!
On Wed, 22 Nov 2000, Juergen Hall wrote:
> hello again,
> another hot question:
> how can i assign two different actions to one
> single form ? (i.e. controlled by means of two graphic
> submit buttons) Both actions have to deliver
> quite the same values to corresponding php-pages.
> I would like to avoid any JavaScript technique here...
> sincerely
> jyrgen
I used in a cart something like this:
[ foo.html ]
<form action="foo.php">
<input type="submit" name="do[action1]" value="Go here!">
<input type="submit" name="do[action2]" value="No! Go here!">
</form>
[ foo.php ]
$do = key ($HTTP_GET_VARS['do']);
switch ($do) {} / if ($do == 'actionx'){} etc.
hope it helps, ciao.
-- teodor