Computer Science Canada

New to ASP, Need help.

Author:  Balmung [ Sun Jun 15, 2008 10:07 am ]
Post subject:  New to ASP, Need help.

Well, someone wanted me to make a site for them but it had to be IIS Compatable, and I am stuck on probally the easiest thing in the world. I am trying to make to so if the time is in a certain range it will say yes or no...


<%
dim h
h=hour(now())

response.write("<p>" & now())
response.write("</p>")

If h>8 and h>18 then
response.write("<span style='color:red; font-weight: bold;'>" & "NO!" & "</span>")
else
response.write("<span style='color:green; font-weight: bold;'>" & "YES!" & "</span>")
end if
%>

=/ thanks in advance

Author:  btiffin [ Tue Jun 17, 2008 11:16 am ]
Post subject:  RE:New to ASP, Need help.

The test h>8 and h >18 looks wrong. NO! will get spanned anytime on or after 7 pm.

Cheers

Author:  Aziz [ Tue Jun 17, 2008 11:38 am ]
Post subject:  RE:New to ASP, Need help.

Depends on the condition. I'm assuming you want NO to show up betweent the hours of 8 and 18, so 8:00 work, 8:01, .., 17:58, 17:59. But 18:00 wouldn't apply.

You're condition would be that 'h' should be greater than or equal to 8, and that 'h' should be less than (but not equal to).

I'll let you write the code for that one.

Also, you don't have to us IIS on a windows machine. You can tell your 'client' that Apache works well on windows: google 'XAMPP' or 'WAMP' (I would recommend XAMPP).

Author:  Balmung [ Wed Jul 02, 2008 12:43 am ]
Post subject:  RE:New to ASP, Need help.

Thanks Smile got it working ^^


: