Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INPUT TYPE='IMAGE' and the VALUE

Status
Not open for further replies.

BlindPete

Programmer
Jul 5, 2000
711
US
I have a POST form with the following inputs. All I am able to retrieve with $HTTP_POST_VARS is cmdVCR.x and cmdVCR.y How do I retieve the VALUE? Or can't I do it with TYPE='IMAGE'.

<INPUT TYPE='IMAGE' NAME='cmdVCR' VALUE='first' SRC='VCR_FIRST.GIF'>
<INPUT TYPE='IMAGE' NAME='cmdVCR' VALUE='prev' SRC='VCR_PREV.GIF'>
<INPUT TYPE='IMAGE' NAME='cmdVCR' VALUE='next' SRC='VCR_NEXT.GIF'>
<INPUT TYPE='IMAGE' NAME='cmdVCR' VALUE='last' SRC='VCR_LAST.GIF'>
-Pete[noevil]
 
$value=$_POST[name] ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
As I understand it, an input of type image does not return an explict value. Rather, it returns the x and y coordinates of where in the image the user clicked.

What you might do is compine your images into a single image which will be your navigation bar. You can then tell by your x and y coordinates where in the image the user clicked. You can then have your PHP script react to that. ______________________________________________________________________
TANSTAAFL!
 
Here's an alternative trick.

Instead of naming all the inputs the same, name them &quot;first[]&quot;, &quot;prev[]&quot;, &quot;next[]&quot;, and &quot;last[]&quot;. $_POST will then have an entry for the image clicked named one of &quot;first&quot;, &quot;prev&quot;, &quot;next&quot;, or &quot;last&quot;, respectively.

Whichever variable is returned, it will be an array which contains the x- and y-coordinates of the click on that image as separate elements.

In any case, all you need do is check which of the four element names exists in $_POST to know which was clicked. ______________________________________________________________________
TANSTAAFL!
 
Thanks to all, I may try sleipnir214's suggestion. I'm just surprised that the IMAGE input can not also have a value. -Pete[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top