Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 New to ASP, Need help.
Index -> Web Design
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Balmung




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: 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
Aziz




PostPosted: 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).
Balmung




PostPosted: Wed Jul 02, 2008 12:43 am   Post subject: RE:New to ASP, Need help.

Thanks Smile got it working ^^
Display posts from previous:   
   Index -> Web Design
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: