|
Posted by Marek Kilimajer on 03/05/05 03:02
Marquez Design wrote:
> Greetings,
>
> I am trying to create a form that will do the following:
>
> First, select a page from a select box,
> Second, click on a button on the side that will do a specific function.
>
> Select page, then with the delete button, delete the file,
> Select page, then with the edit button, edit the page.
>
> Does anyone know how I could do this?
HTML of the buttons:
<input type="image" src="delete.gif" name="delete">
<input type="image" src="edit.gif" name="edit">
Then in the form handling script:
if(isset($_POST['delete_x']) && isset($_POST['delete_y']) {
// delete
}
if(isset($_POST['edit_x']) && isset($_POST['edit_y']) {
// edit
}
If every browser was standards compliant, you could use:
<input type="image" src="delete.gif" name="action" value="delete">
<input type="image" src="edit.gif" name="action" value="edit">
switch($_POST['action']) {
case 'delete':
// delete
break;
case 'edit':
// edit
break;
}
Navigation:
[Reply to this message]
|