Web Hosting Talk







View Full Version : Redirect


ljprevo
09-23-2002, 12:08 PM
I am having a brain fart today.

I want a script where I have a online form with a submit button.

In the form I ask for a user number, name, etc.

i.e. the visitor enters 123456

When they hit submit they are directed to

http://www.domain.com/123456/

But I do not want these numbers to be shown via the source
lookup.

I also would like to modify the url.

If they enter 123456 I could send them to http://www.domain1.com/123456/ or if say they enter
654321 I could send them to http://www.domin2.com/654321/

Also, if incorrect input is entered they would goto a error page.

If anyone could direct me in the right direction or have a workup for this please reply. I was thinking this could be done via PHP.

Rich2k
09-23-2002, 02:27 PM
Well the redirection is easy. It's the fourth example on this page
http://www.php.net/manual/en/function.header.php

To reverse a string use this function
http://www.php.net/manual/en/function.strrev.php

lusid
09-24-2002, 04:05 AM
You could also use the mod_rewrite in apache it's a bit harder but depending of course how you want to check for correct input.