
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:
dim OpenTime, CloseTime
OpenTime = TimeSerial(14, 0, 0)
CloseTime = TimeSerial(15, 0, 0)
IF DateDiff("S", time(), OpenTime) >= 0 _
AND DateDiff("S", time(), CloseTime) <= 0 Then
Response.Write "Site Open"
Else
Response.Write "Site Closed"
Response.Redirect("closed.html")
Response.End
End IF