. If not,
.
>
> 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
Re: Restrict page to open by date????
am 26.12.2006 17:47:16 von exjxw.hannivoort
Mike Brind wrote on 26 dec 2006 in
microsoft.public.inetserver.asp.general:
>> 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
> <%
> Dim opened
> opened = False
> If WeekDay(Now()) >= 7 And Hour(Now()) >= 12 And Minute(Now()) >= 5
What about:
13:04
14:04
..... ?
> Then opened = True
> If WeekDay(Now()) <= 1 And Hour(Now()) <= 22 And Minute(Now()) <> 0
what about 17:00 exactly ?
WeekDay(Now()) >= 7
WeekDay(Now()) <= 1
why the < and the > ?
> Then opened = True
> If opened = False Then Response.Redirect "otherpage"
> %>
>
Try:
<%
If NOT _
( WeekDay(Now())=7 _
AND _
( ( Hour(Now())=12 AND Minute(Now())>4 ) OR Hour(Now())>12 ) )_
AND NOT _
( WeekDay(Now())=1 AND Hour(Now())<22 ) _
Then
Response.Redirect "otherpage"
End If
%>
or [I like this one better]:
<%
mn = Hour(Now())*60 + Minute(Now())
wd = WeekDay(Now())
If NOT ( wd=7 AND mn>12*60+4 ) _
AND NOT ( wd=1 AND mn<22*60 ) Then
Response.Redirect "otherpage"
End If
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Restrict page to open by date????
am 26.12.2006 19:10:32 von Mike Brind
"Evertjan." wrote in message
news:Xns98A5B4F28EA2Beejj99@194.109.133.242...
> Mike Brind wrote on 26 dec 2006 in
> microsoft.public.inetserver.asp.general:
>
>>> 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
>
>> <%
>> Dim opened
>> opened = False
>> If WeekDay(Now()) >= 7 And Hour(Now()) >= 12 And Minute(Now()) >= 5
>
> What about:
> 13:04
> 14:04
> .... ?
>
>> Then opened = True
>> If WeekDay(Now()) <= 1 And Hour(Now()) <= 22 And Minute(Now()) <> 0
>
> what about 17:00 exactly ?
>
> WeekDay(Now()) >= 7
> WeekDay(Now()) <= 1
>
> why the < and the > ?
>
>> Then opened = True
>> If opened = False Then Response.Redirect "otherpage"
>> %>
>>
>
> Try:
>
> <%
> If NOT _
> ( WeekDay(Now())=7 _
> AND _
> ( ( Hour(Now())=12 AND Minute(Now())>4 ) OR Hour(Now())>12 ) )_
> AND NOT _
> ( WeekDay(Now())=1 AND Hour(Now())<22 ) _
> Then
> Response.Redirect "otherpage"
> End If
> %>
>
> or [I like this one better]:
>
> <%
>
> mn = Hour(Now())*60 + Minute(Now())
> wd = WeekDay(Now())
>
> If NOT ( wd=7 AND mn>12*60+4 ) _
> AND NOT ( wd=1 AND mn<22*60 ) Then
> Response.Redirect "otherpage"
> End If
>
> %>
>
I think the most suitable expression I can come up with is Doh!
I prefer your second one too.
--
Re: Restrict page to open by date????
am 26.12.2006 19:36:54 von exjxw.hannivoort
Mike Brind wrote on 26 dec 2006 in microsoft.public.inetserver.asp.general:
> I prefer your second one too.
At my third xmass meal my wandering mind came up with this:
<%
n = DateAdd("h", 6, Now)
'' Time zone correction in my case, server to main user group.
'' Calling now() only once prevents the minute possiblility of a
'' in row date switch.
minutes = (WeekDay(n)-1)*60*24 + Hour(n)*60 + Minute(n)
'' total of minutes since last Sunday 00:00
If ( minutes > 0*60*24+22*60-1 ) OR ( minutes < 6*60*24+12*60+5 ) Then
Response.Redirect "otherpage"
End If
%>
So we skip all those error prone NOTs.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)