andrew_ww Posted January 3, 2007 Share Posted January 3, 2007 Hello,I need to encrypt the query string, is this possible, if so how easy would it be for a newbie to achieve it?Thanks,Andy. Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/ Share on other sites More sharing options...
Jessica Posted January 3, 2007 Share Posted January 3, 2007 This is a vague question.You want it decryptable? Why are you trying to do this anyway? Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152333 Share on other sites More sharing options...
andrew_ww Posted January 3, 2007 Author Share Posted January 3, 2007 Just so people cannot alter the string to bypass the system. Say I have this:[code]http://localhost/test%20site/child.php?recordID=1[/code]There is nothing stopping people from typing:[code]http://localhost/test%20site/child.php?recordID=23[/code]and seeing something they are not suppose to see. Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152337 Share on other sites More sharing options...
Jessica Posted January 3, 2007 Share Posted January 3, 2007 Okay, that isn't really anything to do with encryption.You could use session variables instead of url & GET, and also VALIDATE it.If they're not allowed to have access to 23, when they try to do that, print an error. You have to check for that stuff. Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152341 Share on other sites More sharing options...
andrew_ww Posted January 3, 2007 Author Share Posted January 3, 2007 I'm not sure I understand.Session variable relate to when a user is logged in - correct ?I essentially have a master - detail page setup, surely a session variable can only determine if a user can either access page 'child.php' or not.I cannot see how it could stop 'user1' from typing in a different URL once he's already been logged in and granted a session ? Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152348 Share on other sites More sharing options...
Jessica Posted January 3, 2007 Share Posted January 3, 2007 Okay ignore that.When you $_GET the id, before you display stuff, check if the user has access to that record. What makes you say User X doesn't have access to record 21? That's what you use to validate it. Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152352 Share on other sites More sharing options...
andrew_ww Posted January 3, 2007 Author Share Posted January 3, 2007 Okay - thank you.In this case the site will be used only be a handful of people, so if you can login successfully anything on the site is fair game. The site will restrict people who are not on a list of pre-approved IP addressesI guess my paranoia gland was over working. If it was a simple thing to do I would have implemented it.Cheers,Andy. Quote Link to comment https://forums.phpfreaks.com/topic/32724-encrypt-the-query-string/#findComment-152364 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.