simonp Posted March 1, 2009 Share Posted March 1, 2009 I'm passing an encrypted string to a PHP script but if the string includes a plus sign it gets replaced with a space!? WTF?! Eg: https://www.xxx.com/login.php?u=abc&p=nqB7tQflgsxR4Zag7eAl1ngujbHn+4gKm3rcKLmA1tg= I then use: $encryptedpass = $_GET['p']; but $encryptedpass equals nqB7tQflgsxR4Zag7eAl1ngujbHn 4gKm3rcKLmA1tg= (note the plus sign halfway through has been replaced with a space) How can I stop this happening? Is there a chance other characters could cause a problem? Thanks Simon Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2009 Share Posted March 1, 2009 urlencode, urldecode. Quote Link to comment Share on other sites More sharing options...
simonp Posted March 1, 2009 Author Share Posted March 1, 2009 Thanks thorpe - that worked a treat Cheers Simon Quote Link to comment Share on other sites More sharing options...
killah Posted March 1, 2009 Share Posted March 1, 2009 As for the reason why it replaced it with a space. When a url has a + in it and then you are trying to display it or inserting it, it make's that + a space. Quote Link to comment Share on other sites More sharing options...
simonp Posted March 1, 2009 Author Share Posted March 1, 2009 As for the reason why it replaced it with a space. When a url has a + in it and then you are trying to display it or inserting it, it make's that + a space. Understood. Cheers. 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.