Forum Moderators: open
<input type="submit" value="Submit One" name="first" />
<input type="submit" value="Submit Two" name="second" />
if (isset($_POST['first'])) {
// do something..
}
if (isset($_POST['second'])) {
// do something..
}
Hope that helps. You might need to juggle some code around as well.
dc
Thanks
Ideally you give each button a unique name.
While a unique ID is generally useful for DOM and Javascript referencing, a unique name is not required on input type="submit." It will work just like a radio button unless your browser is doing something funky. Try it.
<input type="submit" value="Submit One" name="SubmitButton">
<input type="submit" value="Submit Two" name="SubmitButton">
if (isset($_POST['submitButton']) && ($_POST['submitButton']=='Submit One')) {
// action 1
}
else {
// action 2
}