cheetahten Posted June 29, 2009 Share Posted June 29, 2009 Newbie here I been playing with a php script that receives allot of paramaters Things like , Size, Upload directory, File names, etc... Anyways, I noticed that allot of the URL for dynamic pages in other sites look like gibberish, specially many image urls... Am assuming these are dynamic or something. Anyways, My question... Do people Encode URL? is this a common practice? for security? Link to comment https://forums.phpfreaks.com/topic/164078-php-url-encoding/ Share on other sites More sharing options...
DEVILofDARKNESS Posted June 29, 2009 Share Posted June 29, 2009 You can do this, but you can also store some parameters in cookies or sessions, depending on how many in the same time their are needed, but url-encoding if ofcourse safer as plain-view. Link to comment https://forums.phpfreaks.com/topic/164078-php-url-encoding/#findComment-865546 Share on other sites More sharing options...
gevans Posted June 29, 2009 Share Posted June 29, 2009 I tend to use urlencode when I'm sending data from page to page using the GET request. THen I'll decode it one the receiving page so it is in the format I want it to be in. As far as the gibberish question with reagrds to displaying images, if the image has been uploaded, and it's path/filename stored in a db, this can be a unique id for referencing the image, maybe the hash of a timestamp and the filename. Consider the following; <?php $filename="myfile"; //file extension removed $timestamp=1246274928; //put it in statically for your viewing pleasure $hashed_filename=md5($timestamp.$filename); echo $hashed_filename;//echos 'd5f9f505a1f710e2f146c32e42e6ad73' Link to comment https://forums.phpfreaks.com/topic/164078-php-url-encoding/#findComment-865548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.