Double PHP Redirect

Unsickle

Golden Member
Feb 1, 2000
1,016
0
0
I'm looking for a double redirection script for a client of mine.

basically it'd work as such:

redir.php?url1=http://blah.com/&url2=http://blah2.com

which would first go to url1, and then redirect to url2

Any help?
 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
im not sure if this'll work but you can try:

header("Location: www.blah1.com");

timeout(1500); //or whatever the function is named for delaying the php script.

header("Location: www.blah2.com");


That's one way to do it.

The other way is to direct it to the www.blah1.com, put in a big delay value, and in index.php of www.blah1.com, put another header("Location: www.blah2.com");
 

Unsickle

Golden Member
Feb 1, 2000
1,016
0
0
I've gotten that far... the problem is that the first URL "blah1.com" never even loads... Any more experienced PHPers?

header("Location: $u1");
usleep(3000);
header("Location: $u2");
 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
I think you can only redirect to web pages on your domain name using that header() function. To re-direct to a completly different website, use php to output the javascript to re-direct.
 

yg17

Member
Jan 17, 2002
151
0
0
so you're on page1.php, and you want it to go to page2.php, then page3.php? right?

on page1.php:
header("page2.php");

on page2.php:
header("page3.php");

and you can use sleep("X"); before header() to delay redirection. Just replace X with the amount of seconds
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
if you need to do that with someone else's content for page 2, since you can't edit their stuff, put them in a frame with a simple meta-refresh redirect or something like that.