Zerpex Posted March 15, 2012 Share Posted March 15, 2012 Hi, I'm trying to make a header("Location: "); where I want, the url I'm currently on, without any ?id=1 etc, so I get /category/editCategory/ instead of /category/editCategory/?id=1 How can I do that, when I do $_SERVER, sometimes I see one called $_SERVER['REQUEST_URL'] (yep, URL, not URI) - which does exactly what I want, but it's only sometimes I have it :S Is there a nice way of doing it? Best regards, Lucas R. Quote Link to comment https://forums.phpfreaks.com/topic/258971-return-requesturi-without-any-params-howto/ Share on other sites More sharing options...
requinix Posted March 15, 2012 Share Posted March 15, 2012 strtok($_SERVER["REQUEST_URI"], "?") That's the method I use. Quote Link to comment https://forums.phpfreaks.com/topic/258971-return-requesturi-without-any-params-howto/#findComment-1327587 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.