Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Tick Boxes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tick Boxes

 Post Reply Post Reply Page  <12
Author
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2005 at 9:03am
Firstly if fld_show is a boolean variable in the database, you shoudln't compare it as a string,

IE story("fld_show") = True NOT story("fld_show") = "True"

Also, change the line to:

<input name="checkbox" type="checkbox" value="true" checked="<%= checkbox %>"/>
Back to Top
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2005 at 9:20am
I have sorted it out. It's now working fine.
All I have to do now is work out how to receive an e-mail when someone adds a comment. I am using formmail. I don't know if you have seen this. It's not bad. The only thing is I can't get it to send me an e-mail when someone adds a comment. It's designed for a contact form with hidden fields on the form and redirects the page to the formmail and then to a thankyou page.
 
Sorry for being a pain.
Thanks for all your help.
 
This is formmail:
 
 
<%@ Language = vbscript%>
<%option explicit %>
<%server.scripttimeout = 600 %>
<%
'declare variables

Dim strFrom, strTo, strSubject, strBody
Dim objMessage, objConfig, strServer, intPort
Dim recipient, redirect, subject, realname, email, required, strEmail1, strEmail2
Dim referer, url, url_verified, icounter, query, iloop, query2, query3, i, agree, validation, error0, error0ok
'############################## CONFIGURATION VARIABLES ####################################
'These are the only lines you will need to change
'--------------------------------------------------------------------------------------------------- -
strServer = "smtp.sccs.camden.sch.uk" 'set which smtp server will be used to send the email. enter ip address or domain name. eg: "xxx.xxx.xxx.xxx" or "smtp.your-domain.com"
intPort = 25 'set the smtp port to be used when sending mail (by default port 25 is used)
'Referrer's Array is defined here. Enter the valid domains which may use this script.
url = Array("www.sccs.camden.sch.uk")'Set which urls that will be accepted. http://xxxxx/
 'Seperate multiple domains by commas
 'eg: url= Array("www.your-domain.com","your-domain.com","www.my-domain.com")
 'computer names can be used instead of domains if this script is being run locally
 'eg: url = Array("computername")
'
'information type and CDOSYS constants
'--------------------------------------------------------------------------------------------------- -
%>
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
'--------------------------------------------------------------------------------------------------- -
'retrieved default fields
'--------------------------------------------------------------------------------------------------- -
recipient = request("recipient")
redirect = request("redirect")
subject = request("subject")
email = request("email")
required = request("required")
if required = "" then
 required = "recipient,subject,email,redirect"
else
 required = "recipient,subject,email,redirect," & required
end if
'--------------------------------------------------------------------------------------------------- -
'verify the referer
'--------------------------------------------------------------------------------------------------- -
referer = request.ServerVariables("HTTP_REFERER")
referer = split(referer,"/")
url_verified = "no"
for icounter = Lbound(url) to Ubound(url) '
 if referer(2) = url(icounter) then
  url_verified = "yes"
 end if
next
if not url_verified = "yes" then
 response.write("The url specified is invalid!")
 response.End
end if
'--------------------------------------------------------------------------------------------------- -
'verify the recipient(not tested)
'--------------------------------------------------------------------------------------------------- -
'trimed_referer = split(referer(2),".")'
'response.write recipient & "<br>" & referer(2) & "=" & trimed_referer(0) & "<br>"
'if trimed_referer(0) = "www" then
' if InStr(1,recipient,trimed_referer(1),1) = 0 then
'  response.write "recipient don't match the referer"
'  response.end
' end if
'else
' if InStr(1,recipient,trimed_referer(0),1) = 0 then
'  response.write "recipient don't match the referer"
'  response.end
' end if
'end if
'--------------------------------------------------------------------------------------------------- -
'retrieve form contents and create email fields
'--------------------------------------------------------------------------------------------------- -
query = Request.ServerVariables("QUERY_STRING")
query = split(query,"&")
query3 = split(required,",")
 For iLoop = Lbound(query) to UBound(query)
  query2 = split(query(iloop),"=")
 
'--------------------------------------------------------------------------------------------------- -
'form validation, checks required fields are not null
'--------------------------------------------------------------------------------------------------- -
  for i = LBound(query3) to UBound(query3)
   if query3(i) = query2(0) then
    if query2(1) = "" then
     response.write ("you must enter a valid ") & query2(0)
     response.end
    end if
   end if
   
   'if query2(0) = "agree" then
    'if query2(1) <> "on" or query2(1) = "" then
    ' response.write("You must agree to terms and conditions to enable Formmailv1.3 to execute!")
    'response.end
    'end if
   'end if
   
'--------------------------------------------------------------------------------------------------- -
'form validation, checks a valid email address has been specified
'--------------------------------------------------------------------------------------------------- -   
   if query2(0) = "email" then
    trim(query2(0))
    if len(query2(1))<8 then
     response.Write("You must specify a valid ") & query2(0)
     response.end
    end if
    if instr(query2(1),"@")=0 and instr(query2(1),".")=0 then
     response.write query2(1)
     response.Write("You must specify a valid ") & query2(0)
     response.end
    end if
    strEmail1 = split(query2(1),"@")
    if len(strEmail1(1))<3 then
     response.Write("You must specify a valid ") & query2(0)
     response.end
    end if
    strEmail2 = split(strEmail1(1),".")
    if len(strEmail2(0))<3 then
     response.Write("You must specify a valid ") & query2(0)
     response.end
    end if
    if len(strEmail2(1))<2 then
     response.Write("You must specify a valid ") & query2(0)
     response.end
    end if
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2005 at 2:52pm
add a javascript event on the checkbox tick to submit the form
Back to Top
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2005 at 5:38am
Thanks for your help. I managed to sort it out. Works fine now.
Thanks.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 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 Notice

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 at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

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