if you don't mind using form buttons, you could do something like this:
your form:
<form method="post" action="handler.php">
(list of items here)
<input type="submit" name="cmd" value="edit">
<input type="submit" name="cmd" value="delete">
<input type="submit" name="cmd" value="email">
<input type="submit" name="cmd" value="serve with potatoes">
</form>
then handler - i changed the name attribute of the submit buttons to 'cmd' so you need to change the first if statement:
// *** HANDLER.PHP ***
if (isset($_POST['cmd'])) {
switch($_POST['cmd']) {
case 'edit':
include('edit_include.php');
break;
case 'delete':
include('delete_include.php');
break;
case 'email':
include('email_include.php');
break;
case 'serve with potatoes':
include('serve_with_potatoes_include.php');
break;
default:
die('unrecognized cmd value');
}
} else {
die ('no data submitted');
}
If you want to use images instead of form buttons, use type='image' for the submit buttons:
<input type="image" name="cmd" value="edit" src="images/edit_button.gif">
If you area really dead set on using <a> tags for the form, you'll need to alter your form, giving it a name and a hidden input named 'cmd' instead of submit buttons.
<form method="post" action="handler.php" name="my_form">
(list of items here)
<input type="hidden" name="cmd" value="">
</form>
and your links will need to trigger a bit of javascript:
<a href="" onClick="document.forms['my_form'].cmd.value='edit';document.forms['my_form'].submit();">edit</a>
or something like that....i'm no javascript pro so if it doesn't work you'll need to maybe post the clientside scripting forum here or google around or something.
EDIT: i posted this but the site ate the javascript...the <a> tag should contain this:
<a href="" onClick="document.forms['my_form'].cmd.value='edit';document.forms['my_form'].submit();">