Re: Image Submits to Forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux