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.
Printable View
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.
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..Quote:
Originally Posted by lie08
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
You could just check for the value of Time() in the .INC file and perform a response.redirect or document.location.href (javascript) accordingly...