ISSET()
How do you Use Multiple Submits in PHP?
In this posting we will look shortly at ISSET() in PHP.
This will show how you can use multiple submit buttons on the same page, yes, even in the same <FORM> tag.
HTML
<HTML><BODY>
<FORM METHOD='POST' ACTION='#'>
<INPUT NAME='show1' TYPE='submit' VALUE='Show text #1'>
<INPUT NAME='show2' TYPE='submit' VALUE='Show text #2'>
</FORM>
</BODY></HTML>
PHP
<?php
if (isset($_POST['show1'])) {
echo "You clicked the first submit button";
}
if (isset($_POST['show2'])) {
echo "You clicked the second submit button";
}
?>