Reply to Re: [PHP] Image Submits to Forms

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация