Page 1 of 1

Best practice to pass variables in url?

Posted: Tue Nov 15, 2011 7:04 am
by tech0925
Hello,

I was wondering what the best method to passing variables in the url would be if you wanted to hide the variable from being so obvious? What I am passing is not sensitive at all but was just curious. I know I could use urlencode to remove spaces and etc..

Ex:

Code: Select all

php?id=1234
This is not sensitive data but it is obvious. I have noticed sites that instead of it looking like that it looks like:

Code: Select all

an-innovative-iphone-developer-game-curriculum-kids/27095603/?backurl=aHR0cHM6Ly93d3cuZWxhbmNlLmNvbS9yL2pvYnMvY2F0LXdlYi1wcm9ncmFtbWluZw==
I am curious to what the cuZWxhbmNlLmNvbS9yL2pvYn is and why, how, and when would I use such a method. Is this md5?

Thanks!

Re: Best practice to pass variables in url?

Posted: Tue Nov 15, 2011 7:09 am
by Celauran
Doesn't look like they're doing anything significantly different. I can't say for certain, of course, but I'd guess that 27095603 is the article ID. 'an-innovative-iphone-developer-game-curriculum-kids' is a slug which may or may not be needed to display the article, but makes the title a little friendlier. Finally, and I'm still guessing here, based on the name, backurl is probably a reference to the referring page/site.

Re: Best practice to pass variables in url?

Posted: Tue Nov 15, 2011 7:16 am
by tech0925
Oh ok. So it is perfectly fine to have a url that looks like php?id=1234 ? Just wanted to make sure that I was doing it correctly. Let's say that the data I wanted to pass was sensitive, what method do I use in that case?

Thanks for the quick reply! You have always been very helpful! :)

Re: Best practice to pass variables in url?

Posted: Tue Nov 15, 2011 8:10 am
by Celauran
I'd use POST over GET for more sensitive information.

Re: Best practice to pass variables in url?

Posted: Tue Nov 15, 2011 8:18 am
by tech0925
Ok, thanks!