[thelist] Form Submission (POST)

Michael Mell mike at nthwave.net
Mon Jun 17 11:09:00 CDT 2002


Use the name of the submit button as the indicator of which button was
pushed.

Here is the contents of a complete test page which does what you desire.
Save it as a file on a server and view it:
++++++++++++++++++
<?
if (isset($proc1)) {
    echo "proc1<br>";
   // do process 1 processing here
} elseif (isset($proc2)) {
    echo "proc2<br>";
   // do process 2 processing here
}

?>

<html>

<form action="<? echo $PHP_SELF; ?>" method="post">
<input type="submit" name="proc1" value="process 1">
<input type="submit" name="proc2" value="process 2">
</form>
</html>

+++++++++++

Mike

if you really want to fake a POST, Python can do that with the
urllib.urlretrieve command.

Burhan Khalid wrote:

> > <form name='form1' action="proc1.php" method="post">
> > <input ...>
> > <input ...>
> > <input type='submit' value='submit 1'>
> > </form>
> > ....
> > <form name='form2' action="proc2.php" method="post">
> > <input ...>
> > <input ...>
> > <input type='submit' value='submit 2'>
> > </form>
> >
>
> Hey Chris :
>
>         This is what I have currently. I would like to have only one
> form, two submit buttons.
> Each button sends a different set of data to the same target.
>
> thanks,
> Burhan
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !

--
mike[at]nthwave.net
llemekim         YahooIM
415.455.8812     voice
419.735.1167     fax





More information about the thelist mailing list