Welcome to WebmasterWorld Guest from 54.221.26.113

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Auto redirect

Auto redirect after 10 seconds

     
3:05 am on Nov 28, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 1, 2005
posts:369
votes: 0


Greetings all.

I'm working on a holiday update for my website and I've got an idea that involves redirection.

I'm trying to write PHP code that will automatically redirect a visitor from page one to page two after say ten seconds.

Help!
4:14 am on Nov 28, 2011 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member leosghost is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Feb 15, 2004
posts:6717
votes: 230


Search for "meta refresh" ( you don't need to use PHP to do what you want..there are various other ways )..HTH :)
11:45 am on Nov 28, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


Or... JavaScript timer event to change the location.href?

You could use PHP to write out the meta refresh (or the JavaScript) but PHP itself cannot do this.

If you use JavaScript you could perhaps allow the user to 'pause' the redirection if required?
3:23 pm on Nov 28, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 15, 2004
posts:941
votes: 0



sleep(10);
header("Location: page-two.htm");


As long as there is no output to screen, this should work.

If you want to redirect user after the page loads, then only javascript can provide you with a solution.
7:51 pm on Nov 28, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Keep-alive may not keep the connection open for that long.

Your redirect also returns a 302 status.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members