Lets say i have a page loaded and the url is:
http://website.com/script.php?id=1
From here, i want it to lets say sort by name everything that is displayed in the id=1 page. Functions for sorting out by name are all set up so all i need to do is add "&sort=name" to the end of "id=1" so the whole url would be:
http://website.com/script.php?id=1&sort=name
Now for it to sort, i would need to have a link somewhere so that it calls this url. What i need help with is, how would i link it so that it just adds "&sort=name" to the end of the whole http://website.com/script.php?id=1 url?
I tried something like: <a href="&sort=name">Click to sort</a>
But all that let me to was:
http://website.com/&sort=name instead of adding it to the
http://website.com/script.php?id=1.
Now your probably jus wonder why not i just link it to the full path, so its: <a href="script.php?id=1&sort=name">Click to sort</a>
Well the thing is, what if id was something different? the function wouldn't work out then and this would only allow me sort only the id=1 page. I have multiple id's and it would just be more convenient if i found out how to just add &sort=name.
I hope its not too confusin and if anyone can help this n00b... it will be greatly appreciated.