Jump to content

Retrieving values from images


portech

Recommended Posts

I have a series of images, I want to retrieve the value of the image that is clicked.

The first hidden input works fine, setting the action type to take the page to a certain location.

I just want to retrieve the value of the image, the standard $_POST('freezer') method does not seem to be working.

Is there any way to group the images?

 

 

$content.="<td><input type=\"hidden\" name=\"action\" value=\"freezer\"><input type=\"image\" src=\"".$freezers[$counter].".jpg\" name=\"freezer\"  value=\"".$freezers[$counter]."\" width=\"100\" height=\"100\"> </td>  ";

 

Link to comment
https://forums.phpfreaks.com/topic/118430-retrieving-values-from-images/
Share on other sites

To use an input type="image" in all browsers, read this - http://www.php.net/manual/en/faq.html.php#faq.html.form-image

 

The HTML standard only requires that an input type="image" send the current value when it is clicked. The current value is defined as the y and x coordinates it was clicked at. Any use of the value="...." parameter is open to browser dependent interpretation and cannot be relied on.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.