Results 1 to 3 of 3

Thread: Online/Offline Status of a certain webpage

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    Online/Offline Status of a certain webpage

    I want my webpage can only be accessible in a specific time. Like in every 2pm then automatically offline after an hour. Can anyone me on this?

    Is it possible to do that in VB6?

    Thank you in advance.

  2. #2

    Lightbulb Re: Online/Offline Status of a certain webpage

    Quote Originally Posted by lie08
    I want my webpage can only be accessible in a specific time. Like in every 2pm then automatically offline after an hour. Can anyone me on this?
    Well depends on how you code your site.. If it is a ASP site, you probaly have some code that is called from all pages of yoursite..
    In my site I have some include files I always include eg. variables-inc.asp
    Then in this file just add some code to test for time:

    VB Code:
    1. dim OpenTime, CloseTime
    2. OpenTime = TimeSerial(14, 0, 0)
    3. CloseTime = TimeSerial(15, 0, 0)
    4.  
    5. IF DateDiff("S", time(), OpenTime) >= 0 _
    6. AND DateDiff("S", time(), CloseTime) <= 0 Then
    7.   Response.Write "Site Open"
    8. Else
    9.   Response.Write "Site Closed"
    10.   Response.Redirect("closed.html")
    11.   Response.End
    12. End IF

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Online/Offline Status of a certain webpage

    You could just check for the value of Time() in the .INC file and perform a response.redirect or document.location.href (javascript) accordingly...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width