useing a form I've tested and found out that it is easy to add a name tag to the submit button and the value, and treat this element like a regular input element, I'm guessing that this is ok but I want more of a conformation on the idea. I've never had reason to check this out before but I'm working on a script where I can either use multipal submit statments in the single form or create the same form over and over again.
Thoughts or advice on this situation is well wanted. Thanks in advance.
A code to describe what I mean:
CODE
<?
if ( $_POST['mode'] == "edit" ) {
echo "you decided to edit page " . $_POST['page'] . ".";
}
elseif ( $_POST['mode'] == "delete" ) {
echo "you decided to delete page " . $_POST['page'] . ".";
}
else {
?>
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">
<select name="page">
<option>Page One</option>
<option>Page Two</option>
<option>Page Three</option>
</select>
<input type="submit" name="mode" value="edit">
<input type="submit" name="mode" value="delete">
</form>
<?
}
?>