I just discovered this little how-to-do in php that I though I would share.
I didn't know that you could have multiple submit buttons in a form and determine which one was clicked on in php. Example:
Code:
<html>
<body>
<form action="myPhp.php" method="post">
<input type="text" name="fName">
<input type="submit" name="update" value="Update Name">
<input type="submit" name="delete" value="Remove My Name">
</form>
</body>
</html>
and the php file goes like this...
Code:
<?php
if(isset($update)) {
print "You're name has been updated";
//do other stuff
}
else if(isset($delete)) {
print "You have been removed";
//do other something
}
else {
print "Huh, I didn't get that? What do you want to do???";
//default something
}
?>
I'm sure you php gurus knew this, but I just discovered it last night in a trial and error frenzy (ie debugging) session.