JonW Posted July 17, 2008 Share Posted July 17, 2008 <form name="<? echo "$a" ?>" action="vanpics.php" method="get"> <input type="hidden" name="van" value="<? echo "$a" ?>"> <input type="hidden" name="model" value="econoline"> <br> <input src="<? echo "$filepath/$filename" ?>" type="image"> </form> So this works fine and all, making the image act as the submit button for an invisible form, etc. Only problem is that the URL it sends to ends up like this: vanpics.php?van=0&model=econoline&x=113&y=96 It sends the coordinates that you clicked on the image, which is kind of ugly to see in the URL. Is there any way to remove that? Link to comment https://forums.phpfreaks.com/topic/115318-using-an-image-to-submit-a-form-methodget/ Share on other sites More sharing options...
unkwntech Posted July 17, 2008 Share Posted July 17, 2008 If this script is doing any queries you'll probably want to move it to $_POST, in addition it will look even prettier. Othewise I suppose you could use a javascript onClick in a standard image tag to submit the form. <img src='path/to/file.ext' onClick="document.myform.submit();"> where myForm = the name param from the <form> Link to comment https://forums.phpfreaks.com/topic/115318-using-an-image-to-submit-a-form-methodget/#findComment-592862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.