kryppienation Posted December 9, 2008 Share Posted December 9, 2008 Howdy! I have a question about $_GET. I have the following code in my page: echo '<tr><td colspan="100%" align="center"><font color="red">'.$deletedmsg.'</font></td></tr>'; echo '<tr><td>From:</td><td>Message:</td><td align="right"><font size="2"><a href="residence.php?action=deleteall&faid='.$id.'">Delete All</a></font></td></tr>'; When a user click the link it does with it's supposed to do, my question however, is there a way to replace the $id with encryption. Once clicked I get this in my browser: http://localhost/kryppienation/home/residence.php?action=deleteall&faid=2 I would really like the number there to be so others cannot see the actual value. Link to comment https://forums.phpfreaks.com/topic/136183-solved-question-about-_get/ Share on other sites More sharing options...
Jibberish Posted December 9, 2008 Share Posted December 9, 2008 you could take a look at mcrypt http://www.php.net/mcrypt As this has a encrypt and decrypt function, so encrypt it with key cypher etc when the url is inserted, then decrypt it on the next page with the same params. Link to comment https://forums.phpfreaks.com/topic/136183-solved-question-about-_get/#findComment-710346 Share on other sites More sharing options...
redarrow Posted December 9, 2008 Share Posted December 9, 2008 mod_rewrite mate... http://www.workingwith.me.uk/articles/scripting/mod_rewrite or use not that secure but worth a go. <?php $url = 'mygold_nugets=?money=1000'; $encodded=base64_encode($url); echo "url encodded $encodded "; $decoded=base64_decode($encodded); echo " <br> url decodded $decoded"; ?> mycript is very powerful well worth the look. but mod_rewrite is as powerful for this task. and tell the truth if the user can not see somethink they shouldnt or effect the database the example i posted is grate. So u no them 1 way encodeing. <?php //encoded but not decodeable. echo sha1("mygold_nugets=?money=1000"); echo "<br><br>"; //encoded but not decodeable. echo md5("mygold_nugets=?money=1000"); echo"<br><br>"; //encoded but not decodeable. echo md5(sha1(md5("mygold_nugets=?money=1000"))); ?> also http://uk2.php.net/crypt Salt with md5 seems to be the best these days i here Link to comment https://forums.phpfreaks.com/topic/136183-solved-question-about-_get/#findComment-710349 Share on other sites More sharing options...
kryppienation Posted December 9, 2008 Author Share Posted December 9, 2008 Redarrow, Thank you very much, your first example will be just fine for my purposes. I was able to make everything work with it and i feel much better about people not being able to see their id. I needed to be able to decode them on the action though, so the second example wouldn't work. Again, thanks for your time and help. ~Kryppie Nation Link to comment https://forums.phpfreaks.com/topic/136183-solved-question-about-_get/#findComment-710364 Share on other sites More sharing options...
redarrow Posted December 9, 2008 Share Posted December 9, 2008 welcome. Link to comment https://forums.phpfreaks.com/topic/136183-solved-question-about-_get/#findComment-710367 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.