Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - some asp help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

some asp help

 Post Reply Post Reply
Author
freakyfred View Drop Down
Groupie
Groupie


Joined: 29 March 2007
Location: United Kingdom
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote freakyfred Quote  Post ReplyReply Direct Link To This Post Topic: some asp help
    Posted: 25 January 2010 at 4:16pm
can someone help me with this Embarrassed


<%

text = Server.URLEncode(request.form("text"))

if Hour(time)>20 OR Hour(time)<3 then

if  not request("text")  = "hello"  Then

    response.write("The text must say <b>hello</b>")

else

response.write("They said <b>hello</b>")

end if
end if


%>




I know i am going very wrong at the start of this but a push in the right direction would be great.




I should also mention that the text box on the form will only be open at the times given so this bit of code to check  only needs to be active at this time also. Hope it makes sense.


Edited by freakyfred - 25 January 2010 at 4:19pm
Back to Top
freakyfred View Drop Down
Groupie
Groupie


Joined: 29 March 2007
Location: United Kingdom
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote freakyfred Quote  Post ReplyReply Direct Link To This Post Posted: 25 January 2010 at 5:28pm
also tried this

if Hour(time)>20 OR Hour(time)<3 AND not request("text") = "hello" then

response.write("wrong")


But this still does not work.
Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 25 January 2010 at 7:49pm
Do you mean like this? Link
If so the code should read:

<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<%
if Hour(time)>20 OR Hour(time)<3 then
response.write("The text must say <b>hello</b>")
else
response.write("They said <b>hello</b>")
end if


%>
<body>
</body>
</html>



Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 25 January 2010 at 7:51pm
Well something like that anyway. Bruce, Scotty32 and others will have the better answers as I'm just a beginner still LOL but it seems to work so what the hell eh? Wink
Back to Top
freakyfred View Drop Down
Groupie
Groupie


Joined: 29 March 2007
Location: United Kingdom
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote freakyfred Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2010 at 10:36am
sorry i should have been a little more clearer as to what i am trying to achieve. Basically what i want is between the hours of 8pm (20:00) and 3am the form to request text or in this case a password.

so the form being something like this..

<%
if Hour(time)>20 OR Hour(time)<3 then
%>


Pass: <input type="password" name="password"> <br>
<%
end if
%>


and then the processing side to also work on the same principal so that when the text box is activated the code to check for the password is also activated but then on other times no password is required so not input box and no password cheking on processing form.

Holpe this is a little clearer


Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2010 at 12:42pm
What you have will never work as 20:00 is a time, and 20 is a number so 20:00 is not going to be more than 20 as they are different data types.

Try looking up the VbScript function DateAdd to be able to handle times in this manner.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.