PDA

View Full Version : image as button adds values to url?


student101
09-08-2008, 05:19 PM
Using an image as a button adds more values to the url?

<form action="search.php" method="get" id="searchform">
<div>
<table class="search">
<tr>
<td><input type="text" value="<?php echo $_GET['q']; ?>" name="q" class="q"/></td>
<td><input type="image" src="img/button.jpg" /></td>
</tr>
</table>
</div>
</form>
search.php?q=Engineering&x=10&y=7
Almost like it's co-ordinates of sorts?

Anyone know what's going on? :confused:

Cheers

edbr
09-09-2008, 01:32 AM
putting
<?php echo $_GET['q']; ?>
on search.php what do you get?

student101
09-09-2008, 06:03 AM
I get the exact value that I typed in.
Not sure what you mean?(t)?

edbr
09-09-2008, 07:05 AM
i always use Post but i just tried with get and received
Apply.php?apply=1111&select=Submit+Query where the value is 1111. normally I use Get is to 'capture, a value sent by URL, Im guessing you are catching all the form elements. BTW it still works using the 1111 to select from my database. Curious :)

student101
09-09-2008, 11:15 AM
Yes, I am also curious as to why this happens?
It's very freakin' ODD!
If I use a standard Submit button - this doesn't happen, these co-ordinates of sorts.

If I find it, i'll post it.

Cheers

student101
09-09-2008, 12:13 PM
It's the purpose of the image;
further reading...
http://www.w3.org/TR/html401/interact/forms.html#submit-button
i always use Post but i just tried with get and received
Apply.php?apply=1111&select=Submit+Query where the value is 1111. normally I use Get is to 'capture, a value sent by URL, Im guessing you are catching all the form elements. BTW it still works using the 1111 to select from my database. Curious :)