Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - redirect in 5 seconds?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

redirect in 5 seconds?

 Post Reply Post Reply
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Topic: redirect in 5 seconds?
    Posted: 05 February 2004 at 11:42am

Hi, how do I edit this code so It will redirect within whatever second I set it to?

<%
session.abandon
response.redirect("/login_form.asp")
%>

Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 11:53am

not possible with serverside... you can place this inside <head></head>:

<meta http-equiv="refresh" content="3;URL=/login_form.asp">



Edited by Semikolon
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2004 at 1:55am

Put a timer function...

<%

'****************************************
'**      Loop for X Seconds          ;   **
'****************************************

Dim intPauseSeconds     'Holds the Number of Seconds to elapse
'Declare the Timers
Dim tmrStartTime
Dim tmrEndTime
Dim tmrRunTime

Public Function funcWaitForTime(intPauseSeconds)
' This Function loops for the number of seconds specified in the strPauseSeconds variable
' The Time() function returns the number of seconds that have elapsed since midnight.
' It is not precise.

tmrRunTime = 0
tmrStartTime = Timer()
tmrEndTime = Timer()

Do while tmrRunTime < intPauseSeconds
   tmrEndTime = Timer()
      'The If statement handles any date change while the loop is executing
      If tmrStartTime > tmrEndTime Then
          tmrEndTime = tmrEndTime + 86400
      end If
    tmrRunTime = tmrEndTime - tmrStartTime
Loop
End Function

funcWaitForTime(5)
session.abandon
response.redirect("/login_forum.asp")
%>


Lead me not into temptation... I know the short cut, follow me.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2004 at 8:44am
looks like it uses a lot of CPU cycles
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2004 at 5:55pm
Yup, but the http refresh does as well although in that case the loop is handled by iis, not by the app so it's more efficient but not great. x86 architectures just don't handle time that well although x86 *nix os's manage to work around it much better than ms.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.