• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Double PHP Redirect

Unsickle

Golden Member
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?
 
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");
 
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");
 
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.
 
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
 
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.
 
Back
Top