"Trevor L." <Trevor_L.@Canberrawrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Marce Poulin wrote:
>I'm trying to find out how I can make a page to be restricted to open
between Saturdays 12:05 pm until Sundays10: pm... and that.. EVERY
WEEK... is there any way at all to do this or is it just simply
impossible.??? thanks
I'd have to think know about doing it using ASP.
The following will set a boolean value to True if the time on the server
falls between the limits set in the OP. If False, it redirects the browser
to another page.
<%
Dim opened
opened = False
If WeekDay(Now()) >= 7 And Hour(Now()) >= 12 And Minute(Now()) >= 5 Then
opened = True
If WeekDay(Now()) <= 1 And Hour(Now()) <= 22 And Minute(Now()) <0 Then
opened = True
If opened = False Then Response.Redirect "otherpage"
%>
>
But with client side Javascript, one could extract the current date and
time and then check it against that time window.
Not a good idea. If the purpose is to prevent access to the content of a
page then client-side javascript can easily be disabled, rendering it
useless.
>
If it is within that time window, then reveal a hidden <div>. If not,
reveal an hidden error <div>.
A side issue is what time?
The time on the visitor's server?
Another good reason not to use client-side code. ASP acts on the hosting
server, where the time zone is predictable. Additionally, placing the
restricted content in a div with it's "visible" set to none does not prevent
the content being readable in the source code of the page. That is no more
secure than using hidden form fields for sensitive information, for example.
--
Mike Brind