PDA

View Full Version : "&x=0&y=0"



julianps
04-20-2009, 12:12 PM
I'm trying to generate a search using an image for the input button but it keeps adding O-R busting "&x=0&y=0" values to the end of the results string, like:

www.mydomain.com/en/index.php?searchtext=value&action=searchresults&x=0&y=0


I searched Google but, given that so many of the queries the searchbot has archived have this component in them I get too many results to be meaningful.

One result (http://www.webmasterworld.com/php/3455642.htm) I did find suggests that there's no issue with "&x=0&y=0" per-se so long as superglobals are switched off, but that's a bit too obtuse for me.

Has anyone else run up against O-R not liking "&x=0&y=0" and does anyone have a nifty workaround?

Thanks,

Jules

the_sandking
04-20-2009, 12:20 PM
OR should not be doing this, the form in your template must be defining X and Y variables someplace.

Without seeing the page in question, it's hard to say.

julianps
04-20-2009, 01:26 PM
My understanding from the thread I referenced in post #1 is that this is a server issue, not an O-R issue ["This occurs when you have <input TYPE=image . . . > "].

The O-R problem is that O-R will not return search results with this extraneous value at the end of the search string. Delete the "&x=0&y=0" and everything is fine.

The HTML looks like this;


<form id="quick-search" action="index.php" method="get" >
<p>
<label for="qsearch">Search:</label>
<input class="tbox" id="qsearch" type="text" name="searchtext" value="Text search&hellip;" title="Start typing and hit ENTER" />
<input type="hidden" name="action" value="searchresults" />
<input type="hidden" name="pclass[]" value="" />
<input class="btn" alt="Search" type="image" title="Search" src="http://www.mydomain.com/rw_common/themes/kis/images/search_blue.gif" />
</p>
</form>


Thanks

Jules

-silent-
04-20-2009, 01:34 PM
its because when you use a img as the button it will add the coordinates to the string that's why you see x and y

best thing is to use css to and clear the button then set a background image then it will work fine as it will still be a submit button so wont need to transmit the x and y coordinates

julianps
04-20-2009, 01:38 PM
its because when you use a img as the button it will add the coordinates to the string that's why you see x and y

best thing is to use css to and clear the button then set a background image then it will work fine as it will still be a submit button so wont need to transmit the x and y coordinates

As a coding novice I could sure do with some help on that.

I tried adding the image to the .btn {} but it did not come through, and when I changed the type to "submit" there was nothing to click on...:confused:

J

pbflash
04-20-2009, 01:44 PM
You could also use a regualr image tag and use the onclick method to submit the form.

<form name="quick-search" id="quick-search" action="index.php" method="get" >
<p>
<label for="qsearch">Search:</label>
<input class="tbox" id="qsearch" type="text" name="searchtext" value="Text search&hellip;" title="Start typing and hit ENTER" />
<input type="hidden" name="action" value="searchresults" />
<input type="hidden" name="pclass[]" value="" />
<img src=http://www.immocherche.com/rw_common/themes/kis/images/search_blue.gif alt="" onClick="document.quick-search.submit()" />
</p>
</form>

julianps
04-22-2009, 12:02 PM
Thanks PB - that worked like a charm :D

Jules