takn25 Posted February 8, 2011 Share Posted February 8, 2011 Hi, i would like to encode a url example. $error="You must be signed in"; $enc=urlencode("http://localhost/finxed/asku/asked.php?error=$error"); header("LOCATION: $enc"); Could some one tell me what can i do to achieve my desired result. I want the header to take to the LOCATION, which is $enc but i wanted it to be encoded when displayed in the url field. The current code is not working. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 8, 2011 Share Posted February 8, 2011 What about it "isn't working"? Quote Link to comment Share on other sites More sharing options...
takn25 Posted February 8, 2011 Author Share Posted February 8, 2011 I get object not found(page not found) with the encoded url but when i try with out encoding it works fine. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 8, 2011 Share Posted February 8, 2011 The only thing you would likely need to use urlencode() on would be the $error variable. Give this a try. $enc=urlencode($error); header("Location: http://localhost/finxed/asku/asked.php?error=$enc"); Quote Link to comment 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.