clairian Posted March 23, 2008 Share Posted March 23, 2008 Hi, i'm pretty new to php and am having trouble trying to secure my data passed over URL's with the urlencode/urldecode functions. I'm using the following to encode the UID: <a href="EditTenantFormT.php?UID=', urlencode(<?php echo $row['UID'] ?>), '">Edit My Details</a><br /> I then want to decode the UID in EditTenantFormT but don't know how I would go about doing this. Any help would really be appreciated. Thanks Claire Link to comment https://forums.phpfreaks.com/topic/97446-urlencodeurldecode/ Share on other sites More sharing options...
KrisNz Posted March 23, 2008 Share Posted March 23, 2008 Your syntax is just a little muddled... <?php $row['UID'] = '&a234#304'; //a value that needs encoding ?> <a href="edittenantformt.php?uid=<?php echo urlencode($row['UID']); ?>">Edit My Details</a> <?php //and then on the edit tentant form... $uid = urldecode($_GET['uid']); ?> Link to comment https://forums.phpfreaks.com/topic/97446-urlencodeurldecode/#findComment-498609 Share on other sites More sharing options...
clairian Posted March 24, 2008 Author Share Posted March 24, 2008 Hi, thanks for the input, however that is still not working. I have changed the syntax of the hyperlink: <a href="EditTenantFormT.php?UID=<?php echo urlencode($row['UID']); ?>">Edit My Details</a And the descode on the edit tenant form is: $UID = urldecode($_GET['UID']); This does pass the UID value through, but the UID value is still seen on the URL that is passed between the two: http://localhost/OceanBlue/EditTenantFormT.php?UID=20 Is there anything else that I am missing? Link to comment https://forums.phpfreaks.com/topic/97446-urlencodeurldecode/#findComment-499406 Share on other sites More sharing options...
trq Posted March 24, 2008 Share Posted March 24, 2008 Of course it is still seen. Read the manual entry for urlencode to see what it actually does. Link to comment https://forums.phpfreaks.com/topic/97446-urlencodeurldecode/#findComment-499412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.