removing query string

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
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

removing query string

Post by newmember »

Lets say user clicks on link with query string...browser sends request to server and server executes my php code...
what i want to do is to remove query string so the browser won't display it when document is sent to it...

I was thinking to take $_SERVER['REQUEST_URI'], remove from it the query string and then send modified Location header (with same $_SERVER['REQUEST_URI'] but without query string)
but i'm not sure it is a correct way to do this...

can someone confirm or suggest something else?
thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I believe that would require another refresh...

may I ask why you don't want to show the query string?
Sounds like poor design and an unnecesary head ache
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

yes i have just started with php
basicly i have a dynamic menu and i want to remember it's state while user goes back and forth...
here is a thead where i asked advice: viewtopic.php?t=26280
at first i thought js will be enough but it is not...
so now i'm using combination of js and sessions to get it done perfectly.js tracks the client actions and sends menu states to php script, the later saves the menu state in session variable, and initializes menu state when page with menu requested...

so what i wanted is to remove from query string the status parameter of menu(which is set by js)
Post Reply