Thread: PHP redirecting
View Single Post
Old 04-14-2007, 01:43 PM   #2 (permalink)
thejeremy
True Techie
 
Join Date: May 2006
Location: Chicago IL
Posts: 104
Send a message via AIM to thejeremy
Default Re: PHP redirecting

You don't need PHP to do it. This is a valid HTML tag I've used before:

<META HTTP-EQUIV="Refresh" CONTENT="10; URL=main.html">

This should be put in the <HEAD> tag of the page you want showing for 10 seconds or so. The "10" means the page will be redirected to the page in the URL field after 10 seconds ("main.html" here).

If you still want to use PHP, you can redirect the user to another site using

header("Location: somelink.php");

...but only if there are no HTML tags prior to this line in your code. To do it after a certain amount of time, it looks similar to the code inside the first tag up there:

header('Refresh: 10; URL=http://www.example.com');

Hope this helps.
__________________
CPU: AMD Athlon 64 X2 5200+ Windsor, 2.6 GHz
RAM: CORSAIR XMS2 2GB 240-Pin DDR2
VIDCARD: EVGA PCI-Express x16 GeForce 7900GS 256MB
MOBO: ASUS M2N-SLI Deluxe AM2
HDD: Seagate Barracuda 320GB 7200 RPM SATA

my blog: http://jspot.gotdns.com
thejeremy is offline   Reply With Quote