dreamwest Posted December 23, 2009 Share Posted December 23, 2009 I want to pass a title through $_GET, but i need to encrypt it so no one can alter the title as they are stored in a database Encrypt the link: $encrypt = "mary had a little lamb"; //encrypt this $link = "http://site.com/index.php?title={$encrypt}"; Link (what the viewer sees) : http://site.com/index.php?title=656gyifhkbu+_tr6$fhjgfjhgjkg play.php: $title = $_GET['title']; //decrypt this so it is the original string "mary had a little lamb" Quote Link to comment https://forums.phpfreaks.com/topic/186116-encrypt-_get/ Share on other sites More sharing options...
rajivgonsalves Posted December 23, 2009 Share Posted December 23, 2009 I don't see how it will have affect encrypting it as the user can still modify the get value, what is your requirement as to why are you passing the value through get ? Quote Link to comment https://forums.phpfreaks.com/topic/186116-encrypt-_get/#findComment-982879 Share on other sites More sharing options...
dreamwest Posted December 23, 2009 Author Share Posted December 23, 2009 Already thought of that - ill just amend a secret code to it eg: $encrypt = "mary had a little lamb *check valid*"; Then str_replace the *check valid* on the decrypted side Quote Link to comment https://forums.phpfreaks.com/topic/186116-encrypt-_get/#findComment-982884 Share on other sites More sharing options...
rajivgonsalves Posted December 23, 2009 Share Posted December 23, 2009 you can check the following, never tried it out but it seems to fit your need http://www.php.net/manual/en/ref.mcrypt.php Quote Link to comment https://forums.phpfreaks.com/topic/186116-encrypt-_get/#findComment-982888 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.