Forum Moderators: coopster

Message Too Old, No Replies

Storing URL's in a database.

Does it matter if they're encoded or not?

         

HughMungus

4:54 am on Dec 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd think decoding them if they're encoded would result in less space being used. Or is it generally bad practice to use decoded URL's altogether? What about decoding for the DB and encoding for display/links?

Salsa

7:57 am on Dec 16, 2004 (gmt 0)

10+ Year Member



HughMungus, that's a nice thought, but I think you'll have problems trying to restore an entire url with urlencode:

urlencode(http://somesite.com/directory/file.php?query=encoding needed);

will produce this:

http%3A%2F%2Fsomesite.com%2Fdirectory%2Ffile.php%3Fquery%3Dencoding+needed

...great if you wanted to send the url in a query string, but not for restoring an entire url.