Page 1 of 1

Making page change location after few seconds

Posted: Wed Feb 26, 2003 8:53 am
by nigma
Anyone know how to make a page change to another page(as if a link was clicked) after like displaying the page for 3 seconds? Like after you add a message it gives you two links, go back and view you message, and edit your message, if you don't click one it will automatically take you to your message.

Someone give me an example of how that is done?

Thanks for all help and advice provided.

Posted: Wed Feb 26, 2003 9:18 am
by volka
when you posted that message you had an example ;)
Within the doucment that told you "Your message has been successfully entered" there is a line

Code: Select all

<meta http-equiv="refresh" content="3;url=viewtopic.php?p=31715#31715">
in the header section, asking the browser to replace this document in 3 seconds by viewtopic.php?p=31715#31715

Posted: Wed Feb 26, 2003 2:28 pm
by nigma
Thanks a bunch! That worked perfectly.

Posted: Sat Mar 01, 2003 10:38 am
by Skyzyx
If you were using JavaScript, you do this:

Code: Select all

setTimeout("location.href='new.htm';", 3000);

Posted: Sat Mar 01, 2003 6:53 pm
by evilcoder
You can even use PHP to do this:

header( "Refresh: 3; url=http://url.com " );

Posted: Thu Jun 05, 2003 9:32 am
by waskelton4
bringing back an old post here...

when using the header("Refresh....

is there any chance this will interfere with the page in any way?
or does it simply wait to perform what would be a header("location:url");?

thanks for the help..

glad i found this one..

Will