> If a form has multiple Submit buttons, how does one find, in php,
> the value of the submit that was used?
> That is, I have one submit to 'Modify' and another to 'Delete" the
> submitted form data.
> <input name="Delete" type="submit" value="Delete">
> <input name="Submit" type="submit" value="Modify">
> if($_POST['Submit'])
> Seems only to provide confirmation that a form was submitted. How do
> I extract the value of the Submit button that was used?
> How can I use php to tell me which of the above Submits was used?
get the *name* of the variable coming in... write conditionals based
on that.
I am not in PHP mode these days, so you'll have to check syntax/write
it yourself.. but something like (pseudo code) -
$deleteVar=$_POST['Delete'];
$sumitVar=$_POST['Submit'];
if ($deleteVar=="Delete") {
dosomething;
} elseif ($sumitVar =="Modify") {
dosomethingElse;
}
..just to give an idea of one myriad ways you can approach this.
------------
Govinda
govinda.webdnat...@gmail.com