Ask a Question related to PHP Development, Design and Development.
-
Cpt John W. Holmes #1
Re: [PHP] Multiple image buttons
From: "Hardik Doshi" <php_hardik@yahoo.com>
Use a method like this:> I have a page on which there are multiple image
> buttons. Is there any way to determine which button is
> pressed by the user?
>
> For example, there is a page on which i display all
> the users of the system with the edit and delete
> button beside each user entry. Now if admin wants to
> delete one of the users then how can i know admin
> pressed which button? It is possible with non-image
> button but image button always give me x and y
> co-ordinates.
>
> Please let me know if you have any clue.
<html>
<form method="POST" action="test.php">
<input type="image" src="image.gif" name="image[1]">
<input type="image" src="image.gif" name="image[2]">
<input type="image" src="image.gif" name="image[3]">
<input type="image" src="image.gif" name="image[4]">
</form>
</html>
<?php
if(isset($_POST['image']))
{
$button = each($_POST['image']);
//$button['key'] will contain the number
//of the button that was clicked on
echo "You pressed button {$button['key']}";
}
?>
Where the number in image[XX] will user_id of the user you want to edit or
delete.
---John Holmes...
Cpt John W. Holmes Guest
-
Multiple buttons on a html form
:confused; Can anyone help me I need to have multiple button on a form 12 to be exact. My form is at... -
Multiple Submit Buttons using the IMAGE type
Hoping one of you gurus can help me out here. I have a form that has 3 buttons that perform different actions when clicked (create new, edit, and... -
Flash, XML, and Image buttons
I want to use xml to populate a flash file and have links as buttons. I can have an xml file populate a swf file, but I also need the links to be... -
Multiple Flash Buttons
I have a flash movie that has MANY buttons for navigation. I want to use 3D so i need to import to director and control my timeline with my flash... -
Multiple image buttons
Hi, I don't understand what you really want to do... what do you mean by "image button" ? an <input type="image"> or <img src=""> ?? On my...



Reply With Quote

