Adding to the URL when performing a search

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tomsace
Forum Contributor
Posts: 167
Joined: Thu Jan 01, 2009 8:07 pm

Adding to the URL when performing a search

Post by tomsace »

Hi,
When I search my website the url is something like this page.php?search=KEYWORD&x=0&y=0.
What I need help with is adding a string to the url, for example page.php?search=KEYWORD&x=0&y=0&sort=name.

Any ideas?
crazycoders
Forum Contributor
Posts: 260
Joined: Tue Oct 28, 2008 7:48 am
Location: Montreal, Qc, Canada

Re: Adding to the URL when performing a search

Post by crazycoders »

Your question is not really developped, i could simply tell you to append that string in your header('location:') but you're maybe not even doing that.

My guess when i see this is that you have a <input type="image"> as your submit button since i see x= and y= in your query string, but i may be wrong. If i'm right and you wish to submit something more with your query string, simply add:

Code: Select all

 
<input type="hidden" name="sort" value="name" />
 
Else, be more explicit or we can't really help with that kind of question
tomsace
Forum Contributor
Posts: 167
Joined: Thu Jan 01, 2009 8:07 pm

Re: Adding to the URL when performing a search

Post by tomsace »

Wow thanks alot got it working with the code you provided.

Thanks alot.
Post Reply