submit form to php script problem
| From: | Mark Colvin | Date: | Wed, 19 Jun 2002 12:32:56 +0000 |
| Subject: | submit form to php script problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102913@lists.php.net to get a copy of this message | ||
I have a form with three submit buttons on it. I would like the form
'action' to be dependant on which submit button the user pressed i.e.
redirect to one of three php script files. Is there any way of doing this
without using client side scripting? I tried the code below where $name
corresponds to one of the submit button names, but I realise this won't work
as the form would have to be sent to the server before $name could be
determined. Any other thoughts would be appreciated.
<form action="<?
switch ($name)
{
case search:
?>searchoutput.php<?
break;
case add:
?>addoutput.php<?
break;
case admin:
?>adminoutput.php<?
break;
}
?>" method="post">
Thanks in advance
Mark
****************************************************
This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message.
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.
****************************************************