Need help with URL encoding

jeephp

Registered
Hi,
I need some help with URL encryption or something similar. For example I have a URL http://www.myurl.com/search.php?iu=321xw1&di=wswe675511&v1=y&u=12qazxq but I do not want it to be displayed with the parameters rather I would like it to be displayed as http://www.myurl.com/search.php?id=eru3893Xwweu327zsdh347ueir3948

What is the best and the most secure way to do this in PHP, I am developing the site on Windows 2003 Enterprise Server Platform and hosting in IIS 6.0.

Does PHP have some inbuilt function to do this or I would have to use a 3rd party tool for this.

Any advice on this would be highly appreciated.

Thanks
 
...then just send them as a POST array instead.

If you still want to use GET, you'll have to come up with an encryption algorithm, to first code it and send it, and then receive, decode and parse it. Depending on how difficult you want the decoding to be, i.e. how hard it should be for your users to crack it, this means more or even more work. I'd go for POST instead.
 
<<What is the best and the most secure way to do this in PHP, I am developing the site on Windows 2003 Enterprise Server Platform and hosting in IIS 6.0.>>

What you are referring to is something the Apache Web Server is capable of called URL Rewrite. This allows you to set up conversion schemes for general url formats that converts URLs on the fly as they are being delivered from the server to the browser client - just for aesthetic purposes, of course, to hide all that ugly parameter formatting without affecting functionality.

Since you are running on IIS, this does you little good. So after a quick Google for URL Rewrite IIS I found lots of links that may help you, though most appear to be commercial.

There may be free solutions out there, but regardless of their price, they have to be installed on the web server - it is still a server-side technology. So if you have access to your server, it's possible. As for PHP, I don't personally know if this can be done, but with my knowledge of how server-side scripting works, I would say it wasn't possible simply through scripting.

=- y knot scrypt -=
 
If you're going for "easy urls" (like Wordpress or other systems use), then the easiest way is to use the mod_rewite feature of Apache; so switching your server over to Apache would be the thing to do. PHP can't do it by itself. Apache is available for Win based systems, though you're better off running it on a Linux based machine. Either way, it's a better option than IIs in terms of security and reliability.

Code:
FROM:  http://www.myurl.com/search.php?iu=321xw1&di=wswe675511&v1=y&u=12qazxq

TO:  http://www.myurl.com/search.php/[b]searchterm[/b]
 
Couldn't you just create a simple PHP encryption method? I.e. base64? And then decrypt it with base 64 and manually parse the variables out? Or am I missing something...
 
Back
Top