redirection to a new url after headers have been passed.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
siddahuja
Forum Newbie
Posts: 1
Joined: Fri Oct 28, 2005 5:03 pm

redirection to a new url after headers have been passed.

Post by siddahuja »

Hi

I am trying to find a method to redirect to a new url once the headers have already been passed.

Please advise.
thanks
sid
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

meta refresh or javascript location method
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Code: Select all

<script language="javascript">
location.replace("http://www.whatever.com")
    </script>
Or if you want a time delay:

Code: Select all

<script language="javascript">
    setTimeout("location.replace(sTargetURL)",  time_in_milliseconds)
    </script>
to get milliseconds just multiply the amount of seconds times 1000
Post Reply