Trying to perform advanced search options with sorting of various ASC or DESC options.
Example URL:
search.php?accom_type=x&no_rooms=x&rooms_total=x&prop_area=x&rent_less=&rent_more=&available=&go=Search &sd=a
Highlighted in bold is & sd (sort direction). Previous variables are passed through the completed form.
Now I have links like this ..
<a href="<?=$_SERVER['REQUEST_URI']?>&sd=a">ASC</a>|<a href="<?=$_SERVER['REQUEST_URI']?>&sd=d">DESC</a>
This is obviously wrong because I use REQUEST_URI - because if a person changes after he was originally set, the URL will look like this:
&sd=a&sd=d
I am sure that I have come across this problem before, but I canโt understand how I solved it.
How to check if GET (for example, sd) is installed, and if so, change it, otherwise add it to the end of the URL to create the links shown above.
Edit: Perhaps a screenshot will help to understand: http://dl.dropbox.com/u/10591127/Capture.PNG
Cheers, Matt
url php get
Matt
source share