I am trying to add a captcha to my website to stop spam it , I have added a captcha code to my current mail form, and it appears to show correctly but on close look you can still send a email without using the captcha, have I put the captcha in the wrong place? any help would be very grateful. this is the mail form: <form action="http://cgi.uk2.net/cgi-bin/uk2-formmail.pl" method="POST">
Help please with captcha html code
5
I am trying to add a captcha to my website to stop spam it , I have added a captcha code to my current mail form, and it appears to show correctly but on close look you can still send a email without using the captcha, have I put the captcha in the wrong place? any help would be very grateful.
this is the mail form:
<form action="http://cgi.uk2.net/cgi-bin/uk2-formmail.pl" method="POST">
<input type="hidden" name="recipient" value="cp124@cometoportugal.com">
<!--- do not change this line --->
<input type="hidden" name="print_config" value="email,subject">
<!--- input all your own fields in sort the order your want them --->
<input type="hidden" name="sort" value="order:message">
<input type="hidden" name="required" value="email,Your Name:,message">
<input type="hidden" name="print_blank_fields" value="1">
E-mail address?<br>
<input type="text" size="35" name="email" value=" "><br>
<input type="hidden" name="realname" value="COMETOPORTUGAL">
<input type="hidden" name="subject" value="Property Enquiry for CP141">
<br>Your Name:<br>
<input type="text" size="35" maxlength="30" name="Your Name:" value=" "><br>
Message<br>
<textarea name="message" rows="2" cols="40"> </textarea><br>
<input type="submit" value="Send message"><input type="reset" value="Clear Form">
</form>
and this is the captcha:
html>
<head>
<title>Captcha</title>
<script type="text/javascript">
//Created / Generates the captcha function
function DrawCaptcha()
{
var a = Math.ceil(Math.random() * 10)+ '';
var b = Math.ceil(Math.random() * 10)+ '';
var c = Math.ceil(Math.random() * 10)+ '';
var d = Math.ceil(Math.random() * 10)+ '';
var e = Math.ceil(Math.random() * 10)+ '';
var f = Math.ceil(Math.random() * 10)+ '';
var g = Math.ceil(Math.random() * 10)+ '';
var code = a + ' ' + b + ' ' + ' ' + c + ' ' + d + ' ' + e + ' '+ f + ' ' + g;
document.getElementById("txtCaptcha").value = code
}
// Validate the Entered input aganist the generated security code function
function ValidCaptcha(){
var str1 = removeSpaces(document.getElementById('txtCaptcha') .value);
var str2 = removeSpaces(document.getElementById('txtInput').v alue);
if (str1 == str2) return true;
return false;
}
// Remove the spaces from the entered and generated code
function removeSpaces(string)
{
return string.split(' ').join('');
}
</script>
the webpage that has the complete for on is:
http://www.cometoportugal.com/properties/page122.html
this is the mail form:
<form action="http://cgi.uk2.net/cgi-bin/uk2-formmail.pl" method="POST">
<input type="hidden" name="recipient" value="cp124@cometoportugal.com">
<!--- do not change this line --->
<input type="hidden" name="print_config" value="email,subject">
<!--- input all your own fields in sort the order your want them --->
<input type="hidden" name="sort" value="order:message">
<input type="hidden" name="required" value="email,Your Name:,message">
<input type="hidden" name="print_blank_fields" value="1">
E-mail address?<br>
<input type="text" size="35" name="email" value=" "><br>
<input type="hidden" name="realname" value="COMETOPORTUGAL">
<input type="hidden" name="subject" value="Property Enquiry for CP141">
<br>Your Name:<br>
<input type="text" size="35" maxlength="30" name="Your Name:" value=" "><br>
Message<br>
<textarea name="message" rows="2" cols="40"> </textarea><br>
<input type="submit" value="Send message"><input type="reset" value="Clear Form">
</form>
and this is the captcha:
html>
<head>
<title>Captcha</title>
<script type="text/javascript">
//Created / Generates the captcha function
function DrawCaptcha()
{
var a = Math.ceil(Math.random() * 10)+ '';
var b = Math.ceil(Math.random() * 10)+ '';
var c = Math.ceil(Math.random() * 10)+ '';
var d = Math.ceil(Math.random() * 10)+ '';
var e = Math.ceil(Math.random() * 10)+ '';
var f = Math.ceil(Math.random() * 10)+ '';
var g = Math.ceil(Math.random() * 10)+ '';
var code = a + ' ' + b + ' ' + ' ' + c + ' ' + d + ' ' + e + ' '+ f + ' ' + g;
document.getElementById("txtCaptcha").value = code
}
// Validate the Entered input aganist the generated security code function
function ValidCaptcha(){
var str1 = removeSpaces(document.getElementById('txtCaptcha') .value);
var str2 = removeSpaces(document.getElementById('txtInput').v alue);
if (str1 == str2) return true;
return false;
}
// Remove the spaces from the entered and generated code
function removeSpaces(string)
{
return string.split(' ').join('');
}
</script>
the webpage that has the complete for on is:
http://www.cometoportugal.com/properties/page122.html
- KirkMcD
- [1] reply
- algarve
- Dong Lee
- ashok999333
Next Topics on Trending Feed
-
5