PDA

View Full Version : Php Redirect



guidom64
11-03-2007, 02:19 PM
Is someone out there who can help me to set up a PHP redirect.

I had once a sample code, but I cant find it anymore. I simply place the code in a white page who tells

Redirecting, please wait.....
If it does not open a new Window after 15 seconds, click here

and upload it to the correct place, Right ?

Thanks for helping me out.

superiornc.com
11-03-2007, 02:20 PM
i would go to google or dogpile.com and search php redirector

linFox
11-04-2007, 06:57 AM
If you want to redirect after a set time (ie. only start redirecting after x seconds), the very simplest thing to do would be to use the HTTP header, redirect.

Eg: <meta http-equiv="refresh" content="15;url=http://www.domain.com/page.php">

Put that in the head of the blank redirect page, changing the 15 to the length in seconds to wait, and http://www.domain.com/page.php to the url to redirect to.

If you want to redirect instantly using PHP, the following line will do it:

header("Location: http://www.domain.com/page.php");

guidom64
11-04-2007, 09:16 AM
Hy LinFox

The php I lost was a huge amount of code, I'm surprised.
It's only the part in the ( ) or with the - header( ) - together ?

I must sound like a ignorant but I had no clue that it's that easy to make a php redirect. So I just put that code in a xx.htm page that I want to redirect, and done.
It's so simple its almost silly I have asked.

Thanks again LinFox