PDA

View Full Version : redirect to different page after x seconds


CdnGal
01-12-2003, 06:09 AM
Hi, all

Hopefully this is very easy for you experienced coders out there. (not so easy for newbie here) Using ASP, how do I create, for example, a Welcome page (with just a little information presented) that will automatically take the user to the Home page after X number of seconds. The user will be given a button on the welcome page to click on to go to the home page, but if they do nothing I want it to automatically take them there after 4 seconds (don't ask...I need to do it this way.

Thanks!

codefox
01-12-2003, 09:08 AM
You could do it using the META tag as
<META http-equiv="REFRESH" content="4; URL=nextpage.asp">

Or, using ASP code as
<%
Delay 4
Server.Execute("nextpage.asp")

Sub Delay(iSecs)
iTime = Second(Time())
While (Second(Time()) - iTime) < iSecs
' Wait
Wend
End Sub
%>

CdnGal
01-12-2003, 10:29 PM
Thanks very much for the reply. I'll give it a shot.

CdnGal
01-13-2003, 12:22 AM
by the way, the meta-etc... worked! Thanks for the help!