Image verification

Hi,
I seem to be having trouble adding an image verification to the php code I have.

I have my index.php page with the contact form on and contact.php to verify everything plus the javascript.

index.php:

<form id=“contactForm” method=“post” action=“contact.php”>
<p>
<input id=“name” class=“textInput toggle” type=“text” name=“name” value=“Name” autocomplete=“off” /><br />
<small class=“errorText”>Please write a valid name bigger than 3 letters.</small>
</p>

                    &lt;p&gt; 
                        &lt;input id="email" class="textInput toggle" type="text" name="email"  value="Email" autocomplete="off" /&gt;&lt;br /&gt; 
                        &lt;small class="errorText"&gt;Please write a valid email address.&lt;/small&gt; 
                    &lt;/p&gt; 
                    
                    &lt;p&gt; 
                    	&lt;img src="verificationimage.php?9293" width="91" height="28" /&gt; 
                        &lt;input id="verif_box" class="textInput toggle" type="text" name="verif_box" autocomplete="off" /&gt; 
                        &lt;small class="errorText"&gt;Please write a valid verification code.&lt;/small&gt; 
                    
                    &lt;/p&gt; 
                    
                                       
                    &lt;p&gt; 
                        &lt;textarea id="message" class="textarea toggle" name="message" rows="11" cols="25"&gt;Message&lt;/textarea&gt;&lt;br /&gt; 
                        &lt;small class="errorText"&gt;Please write message bigger that 10 letters.&lt;/small&gt; 
                    &lt;/p&gt; 
                    
                    &lt;p class="contactFooter"&gt; 
                        &lt;small class="requierd"&gt;All fields are required!&lt;/small&gt; 
                        
                        &lt;img id="loading" src="style/images/loading.gif" alt="Loading" /&gt; 
                        
                        &lt;span id="submit" class="button"&gt; 
                        	&lt;input name="submitted" id="submitted" type="submit" value="send" /&gt; 
                        &lt;/span&gt;               
                    &lt;/p&gt; 
                    
                    &lt;p id="response"&gt;&lt;/p&gt;   
                &lt;/form&gt; 

contact.php:

<?php
// Write bellow the email address where you want to receive the messages
$email = “webmaster@site.com”;

// Ensure that this page it’s not loaded directly
if(isset($_POST[‘name’])){

// Declare a variable for storing errors
$errors = array();

// Get the information from the contact form
$inputName = strip_tags($_POST['name']);
$inputEmail = strip_tags($_POST['email']);	
$inputMessage = strip_tags($_POST['message']);
$inputVerifBox = strip_tags($_POST['verif_box']);

// Declare an aray whith the form fields that are requierd
$required = array('Name field' =&gt; 'name', 'Email field' =&gt; 'email', 'Message field' =&gt; 'message');

// Make sure that the requierd fields are not empty
foreach($required as $key=&gt;$value){
	if(isset($_POST[$value]) && $_POST[$value] !== ''){continue;}
	else{$errors[] = '&lt;small class="errorText"&gt;' . $key . ' cannot be left blank.&lt;/small&gt;&lt;br /&gt;';}
}

// Make sure the email is valid. 
if (!validateEmail($inputEmail)) $errors[] = '&lt;small class="errorText"&gt;Please write a valid email address.&lt;/small&gt;&lt;br /&gt;';

// Make sure the verifcation image is valid. 
if (!validateVerifBox($inputVerifBox)) $errors[] = '&lt;small class="errorText"&gt;Please write a valid code.&lt;/small&gt;&lt;br /&gt;';

// Start composing the message
$message = "You have received this message from the contact form placed on " . $_SERVER['HTTP_HOST'] ."\


";

$message .= "NAME: $inputName\

";
$message .= "EMAIL: $inputEmail
";

$message .= "\

MESSAGE:

$inputMessage";

//Check for errors
if(empty($errors)){
	// If no error then send the mail
	if(mail($email, "Message from $inputName - On " . $_SERVER['HTTP_HOST'], $message, "From: $inputEmail")){
		echo '&lt;small&gt;Your message was sent.&lt;/small&gt;';
	}else{
		echo '&lt;small class="errorText"&gt;There was a problem sending your message. Please Try again.&lt;/small&gt;&lt;br /&gt;';
	}
}else{
	// If errors then ouput them
	echo implode('&lt;br /&gt;', $errors);
}

}else{
die(‘Please do not load this page directly.’);
}

function validateEmail($email){
if(eregi(“[1]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$”, $email)) return true;
else return false;
}
?>

and … Contact.js:

$(document).ready(function() {

// Contact Form
var cForm = $("#contactForm");  
var cinputName = cForm.find("#name"); 
var cinputEmail = cForm.find("#email");  
var cinputMessage = cForm.find("#message");
var cloadingImage = cForm.find('#loading');	
var cresponseText = cForm.find("#response");

// On Submitting  	
cForm.bind("submit", function(e){
	if(validateName(e, cinputName) & validateEmail(e, cinputEmail) & validateMessage(e, cinputMessage)) { 
		ajaxSend(cForm, cresponseText, cloadingImage);
	};
	return false;
});
	
// On key press  
cinputName.bind("keyup", function(e){
	validateName(e,  cinputName);
});
cinputEmail.bind("keyup", function(e){
	validateEmail(e,  cinputEmail);
});
cinputMessage.bind("keyup", function(e){
	validateMessage(e,  cinputMessage);
});

});

// Helper functions requierd by the contact form
function validateName(event, input){
if( input.val().length < 4 || input.val() == “Name” ){
if(event.type != “keyup”) {
input.addClass(“error”);
input.nextAll(‘.errorText’).slideDown();
}
return false;
} else {
input.removeClass(“error”);
input.nextAll(‘.errorText’).slideUp();
return true;
}
}

function validateEmail(event, input){
var a = input.val();
var filter = /[2]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;

if( filter.test(a) ){
	input.removeClass("error"); 
	input.nextAll('.errorText').slideUp(); 
	return true;
}else{
	if(event.type != "keyup") {
		input.addClass("error"); 
		input.nextAll('.errorText').slideDown(); 
	}
	return false;
}

}

function validateMessage(event, input){
if( input.val().length < 10 || input.val() == “your message” ){
if(event.type != “keyup”) {
input.addClass(“error”);
input.nextAll(‘.errorText’).slideDown();
}
return false;
}else{
input.removeClass(“error”);
input.nextAll(‘.errorText’).slideUp();
return true;
}
}

function ajaxSend(form, response, loading){
loading.show();

response.slideUp().animate({X:""} , 200, "linear", function(){
	response.html('&lt;small&gt;Please wait, your message is being processed.&lt;/small&gt;&lt;br /&gt;').slideDown();		
});

// Make AJAX request 		
$.post('contact.php', form.serialize(), function(data){
	loading.hide(200);
	response.slideUp().animate({X:""} , 200, "linear", function(){ response.html(data).slideDown(); });
});

//Cancel default action
return false;

};

I’m using verif_box as the input and the image is above it. I have tried editing the contact.php, so that it would accept verif_box and give it chjaracter and numeral restrictions, so that spammers can’t abuse the form.

Any help would be great, but please, if you do have a solution please make sure I can understand it as I’m new to this.

Thanks.


  1. A-Z0-9._%- ↩︎

  2. a-zA-Z0-9 ↩︎

“parse error syntax error unexpected “;” on line 15.”

Try below contact.php


<?php
// Write bellow the email address where you want to receive the messages
$email = "webmaster@site.com";

// Ensure that this page it's not loaded directly
if(isset($_POST['name'])) {

	// Declare a variable for storing errors
	$errors = array();

	// Get the information from the contact form
	$inputName		= strip_tags($_POST['name']);
	$inputEmail		= isset($_POST['email']) ? strip_tags($_POST['email']) : null;
	$inputMessage	= isset($_POST['message']) ? strip_tags($_POST['message']) : null;
	$inputVerifBox	= isset($_POST['verif_box']) ? strip_tags($_POST['verif_box']) ? null;

	// Declare an aray whith the form fields that are requierd
	$required = array('Name field' => 'name', 'Email field' => 'email', 'Message field' => 'message');

	// Make sure that the required fields are not empty
	foreach($required as $key=>$value){
		if(isset($_POST[$value]) && $_POST[$value] !== ''){continue;}
		else{$errors[] = '<small class="errorText">' . $key . ' cannot be left blank.</small><br />';}
	}

	// Make sure the email is valid.
	if (!validateEmail($inputEmail)) $errors[] = '<small class="errorText">Please write a valid email address.</small><br />';

	// Make sure the verifcation image is valid.
	if (!validateVerifBox($inputVerifBox)) $errors[] = '<small class="errorText">Please write a valid code.</small><br />';

	// Start composing the message
	$message = "You have received this message from the contact form placed on " . $_SERVER['HTTP_HOST'] ."\
\
";

	$message .= "NAME: $inputName\
";
	$message .= "EMAIL: $inputEmail\
";

	$message .= "\
MESSAGE:\
\
 $inputMessage";

	//Check for errors
	if(empty($errors)){
		// If no error then send the mail
		if(mail($email, "Message from $inputName - On " . $_SERVER['HTTP_HOST'], $message, "From: $inputEmail")){
			echo '<small>Your message was sent.</small>';
		} else {
			echo '<small class="errorText">There was a problem sending your message. Please Try again.</small><br />';
		}
	} else {
		// If errors then ouput them
		echo implode('<br />', $errors);
	}

} else {
	die('Please do not load this page directly.');
}

function validateEmail($email){
	if(eregi("^[A-Z0-9._&#37;-]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}$", $email)) return true;
	else return false;
}

function validateVerifBox($inputVerifBox) {
	$out = false;
	
	if (strlen($inputVerifBox) > 0 && md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = true;
	
	return $out;
}
?> 

replaced line 15 with…


$inputVerifBox	= isset($_POST['verif_box']) ? strip_tags($_POST['verif_box']) : null;

Input on verification box with empty returns the expected message which fixes the problem…but with an input box having NOT EQUAL captcha value is still need fixing.

On the email side…“$email = “webmaster@site.com”;” is your email or you’ve just copy/paste the code from somewhere else?

my e-mail is me@leecraigstewart.com. I’ve already got that in my contact.php file.

Okay, so let’s recap…

contact.js…

$(document).ready(function() {
// Contact Form
var cForm = $(“#contactForm”);
var cinputName = cForm.find(“#name”);
var cinputEmail = cForm.find(“email”);
var cinputMessage = cForm.find(“#message”);
var cinputCaptcha = cForm.find(“#verif_box”);
var cloadingImage = cForm.find(‘#loading’);
var cresponseText = cForm.find(“#response”);

// On Submitting
cForm.bind("submit", function(e){
    if( validateName(e, cinputName) &
        validateEmail(e, cinputEmail) &
        validateMessage(e, cinputMessage) &
        validateCaptcha(e, cinputCaptcha)
        ) {
        ajaxSend(cForm, cresponseText, cloadingImage);
    };

    return false;
});

// On key press
cinputName.bind("keyup", function(e){
    validateName(e, cinputName);
});

cinputEmail.bind("keyup", function(e){
    validateEmail(e, cinputEmail);
});

cinputMessage.bind("keyup", function(e){
    validateMessage(e, cinputMessage);
});

cinputCaptcha.bind("keyup", function(e){
    validateMessage(e, cinputCaptcha);
});

});

// Helper functions requierd by the contact form
function validateName(event, input){
if( input.val().length < 4 || input.val() == “Name” ){
if(event.type != “keyup”) {
input.addClass(“error”);
input.nextAll(‘.errorText’).slideDown();
}

    return false;
} else {
    input.removeClass("error");
    input.nextAll('.errorText').slideUp();
    return true;
}

}

function validateEmail(event, input){
var a = input.val();
var filter = /[1]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;

if( filter.test(a) ){
    input.removeClass("error");
    input.nextAll('.errorText').slideUp();
    return true;
} else {
    if(event.type != "keyup") {
        input.addClass("error");
        input.nextAll('.errorText').slideDown();
    }

    return false;
}

}

function validateMessage(event, input){
if( input.val().length < 10 || input.val() == “your message” ){
if(event.type != “keyup”) {
input.addClass(“error”);
input.nextAll(‘.errorText’).slideDown();
}

    return false;
} else {
    input.removeClass("error");
    input.nextAll('.errorText').slideUp();
    return true;
}

}

function validateCaptcha(event, input){
if( input.val().length == 0){
if(event.type != “keyup”) {
input.addClass(“error”);
input.nextAll(‘.errorText’).slideDown();
}

    return false;
} else {
    input.removeClass("error");
    input.nextAll('.errorText').slideUp();
    
    return true;
}

}

function ajaxSend(form, response, loading){
loading.show();

response.slideUp().animate({X:""} , 200, "linear", function(){
response.html('&lt;small&gt;Please wait, your message is being processed.&lt;/small&gt;&lt;br /&gt;').slideDown();

});

// Make AJAX request
$.post(‘contact.php’, form.serialize(), function(data){
loading.hide(200);
response.slideUp().animate({X:“”} , 200, “linear”, function(){ response.html(data).slideDown(); });
});

//Cancel default action
return false;
};

contact.php…

<?php
// Write bellow the email address where you want to receive the messages
$email = “webmaster@site.com”;

// Ensure that this page it’s not loaded directly
if(isset($_POST[‘name’])){

// Declare a variable for storing errors
$errors = array();

// Get the information from the contact form
$inputName = strip_tags($_POST['name']);
$inputEmail = strip_tags($_POST['email']);	
$inputMessage = strip_tags($_POST['message']);
if (strlen($inputVerifBox) &gt; 0 && md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = true;

// Declare an aray whith the form fields that are requird
$required = array('Name field' =&gt; 'name', 'Email field' =&gt; 'email', 'Message field' =&gt; 'message');

// Make sure that the requierd fields are not empty
foreach($required as $key=&gt;$value){
	if(isset($_POST[$value]) && $_POST[$value] !== ''){continue;}
	else{$errors[] = '&lt;small class="errorText"&gt;' . $key . ' cannot be left blank.&lt;/small&gt;&lt;br /&gt;';}
}

// Make sure the email is valid. 
if (!validateEmail($inputEmail)) $errors[] = '&lt;small class="errorText"&gt;Please write a valid email address.&lt;/small&gt;&lt;br /&gt;';

// Make sure the verif_box is valid. 
if (!validateEmail($inputVerifBox)) $errors[] = '&lt;small class="errorText"&gt;Please enter the correct verification code.&lt;/small&gt;&lt;br /&gt;';

// Start composing the message
$message = "You have received this message from the contact form placed on " . $_SERVER['HTTP_HOST'] ."\


";

$message .= "NAME: $inputName\

";
$message .= "EMAIL: $inputEmail
";

$message .= "\

MESSAGE:

$inputMessage";

//Check for errors
if(empty($errors)){
	// If no error then send the mail
	if(mail($email, "Message from $inputName - On " . $_SERVER['HTTP_HOST'], $message, "From: $inputEmail")){
		echo '&lt;small&gt;Your message was sent.&lt;/small&gt;';
	}else{
		echo '&lt;small class="errorText"&gt;There was a problem sending your message. Please Try again.&lt;/small&gt;&lt;br /&gt;';
	}
}else{
	// If errors then ouput them
	echo implode('&lt;br /&gt;', $errors);
}

}else{
die(‘Please do not load this page directly.’);
}

function validateEmail($email){
if(eregi(“[2]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$”, $email)) return true;
else return false;
}
function validateVerifBox($inputVerifBox) {
$out = true;

if (strlen($inputVerifBox) === 0 || md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = false;

return $out;

}
?>

I clicked on submit button and nothing has shown both when I have and haven’t filled in the verification code. And I haven’t received an email too. :frowning:


  1. a-zA-Z0-9 ↩︎

  2. A-Z0-9._%- ↩︎

Where exactly do I put this, I’ve put it below the validateVerifBox line and it’s coming up with parse error syntax error unexpected T string. If you could show me where to put it exactly, as I said, I’m new to this. Thanks.

On your contact.php add below checking or similar validation…


//from setcookie('tntcon',(md5($rand_string).'a4xn'));
if(!isset($_POST[''verif_box']) && md5($_POST[''verif_box'].'a4xn') !== (string)$_COOKIE['tntcon'])  {
die("code not valid...");
}

What if I just add a required to be ticked box instead? Could it stop spammers I wonder?
If the box doesn’t get ticked then they can’t submit the form.

update the corresponding JS as well…Contact.js, the error is present but was hidden so JS is needed to have it shown.


$(document).ready(function() {
	// Contact Form
	var cForm = $("#contactForm");
	var cinputName = cForm.find("#name");
	var cinputEmail = cForm.find("#email");
	var cinputMessage = cForm.find("#message");
	var cinputCaptcha = cForm.find("#verif_box");
	var cloadingImage = cForm.find('#loading');
	var cresponseText = cForm.find("#response");

	// On Submitting
	cForm.bind("submit", function(e){
		if( validateName(e, cinputName) &
			validateEmail(e, cinputEmail) &
			validateMessage(e, cinputMessage) &
			validateCaptcha(e, cinputCaptcha)
			) {
			ajaxSend(cForm, cresponseText, cloadingImage);
		};
	
		return false;
	});

	// On key press
	cinputName.bind("keyup", function(e){
		validateName(e, cinputName);
	});
	
	cinputEmail.bind("keyup", function(e){
		validateEmail(e, cinputEmail);
	});
	
	cinputMessage.bind("keyup", function(e){
		validateMessage(e, cinputMessage);
	});
	
	cinputCaptcha.bind("keyup", function(e){
		validateMessage(e, cinputCaptcha);
	});

});

// Helper functions requierd by the contact form
function validateName(event, input){
	if( input.val().length < 4 || input.val() == "Name" ){
		if(event.type != "keyup") {
			input.addClass("error");
			input.nextAll('.errorText').slideDown();
		}
		
		return false;
	} else {
		input.removeClass("error");
		input.nextAll('.errorText').slideUp();
		return true;
	}
}

function validateEmail(event, input){
	var a = input.val();
	var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;

	if( filter.test(a) ){
		input.removeClass("error");
		input.nextAll('.errorText').slideUp();
		return true;
	} else {
		if(event.type != "keyup") {
			input.addClass("error");
			input.nextAll('.errorText').slideDown();
		}
	
		return false;
	}
}

function validateMessage(event, input){
	if( input.val().length < 10 || input.val() == "your message" ){
		if(event.type != "keyup") {
			input.addClass("error");
			input.nextAll('.errorText').slideDown();
		}
		
		return false;
	} else {
		input.removeClass("error");
		input.nextAll('.errorText').slideUp();
		return true;
	}
}

function validateCaptcha(event, input){
	if( input.val().length == 0){
		if(event.type != "keyup") {
			input.addClass("error");
			input.nextAll('.errorText').slideDown();
		}

		return false;
	} else {
		input.removeClass("error");
		input.nextAll('.errorText').slideUp();
		
		return true;
	}
}

function ajaxSend(form, response, loading){
	loading.show();

	response.slideUp().animate({X:""} , 200, "linear", function(){
	response.html('<small>Please wait, your message is being processed.</small><br />').slideDown();
});

// Make AJAX request
$.post('contact.php', form.serialize(), function(data){
	loading.hide(200);
	response.slideUp().animate({X:""} , 200, "linear", function(){ response.html(data).slideDown(); });
});

//Cancel default action
	return false;
};

Still no change:-

<?php
// Write bellow the email address where you want to receive the messages
$email = "me@leecraigstewart.com";

// Ensure that this page it's not loaded directly
if(isset($_POST['name'])) {

    // Declare a variable for storing errors
    $errors = array();

    // Get the information from the contact form
    $inputName        = strip_tags($_POST['name']);
    $inputEmail        = isset($_POST['email']) ? strip_tags($_POST['email']) : null;
    $inputMessage    = isset($_POST['message']) ? strip_tags($_POST['message']) : null;
    $inputVerifBox	= isset($_POST['verif_box']) ? strip_tags($_POST['verif_box']) : null;

    // Declare an aray whith the form fields that are requierd
    $required = array('Name field' => 'name', 'Email field' => 'email', 'Message field' => 'message');

    // Make sure that the required fields are not empty
    foreach($required as $key=>$value){
        if(isset($_POST[$value]) && $_POST[$value] !== ''){continue;}
        else{$errors[] = '<small class="errorText">' . $key . ' cannot be left blank.</small><br />';}
    }

    // Make sure the email is valid.
    if (!validateEmail($inputEmail)) $errors[] = '<small class="errorText">Please write a valid email address.</small><br />';

    // Make sure the verifcation image is valid.
    if (!validateVerifBox($inputVerifBox)) $errors[] = '<small class="errorText">Please write a valid code.</small><br />';

    // Start composing the message
    $message = "You have received this message from the contact form placed on " . $_SERVER['HTTP_HOST'] ."\
\
";

    $message .= "NAME: $inputName\
";
    $message .= "EMAIL: $inputEmail\
";

    $message .= "\
MESSAGE:\
\
 $inputMessage";

    //Check for errors
    if(empty($errors)){
        // If no error then send the mail
        if(mail($email, "Message from $inputName - On " . $_SERVER['HTTP_HOST'], $message, "From: $inputEmail")){
            echo '<small>Your message was sent.</small>';
        } else {
            echo '<small class="errorText">There was a problem sending your message. Please Try again.</small><br />';
        }
    } else {
        // If errors then ouput them
        echo implode('<br />', $errors);
    }

} else {
    die('Please do not load this page directly.');
}

function validateEmail($email){
    if(eregi("^[A-Z0-9._&#37;-]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}$", $email)) return true;
    else return false;
}

function validateVerifBox($inputVerifBox) {
    $out = true;
    
    if (strlen($inputVerifBox) === 0 || md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = false;
    
    return $out;
}
?>

Was “verificationimage.php?9293” the “9293” hidden value to be compared of? or was it saved on session which later on “contact.php” get to be compared on $_POST['‘verif_box’]?

It has no relation to the php contact script, it’s just an image verification I got somewhere else.

verificationimage.php:

<?php
// -----------------------------------------

// The Web Help .com

// -----------------------------------------

header(‘Content-type: image/jpeg’);

$width = 71;

$height = 28;

$my_image = imagecreatetruecolor($width, $height);

imagefill($my_image, 0, 0, 0xF2F2F2);

// add noise

for ($c = 0; $c < 40; $c++){

$x = rand(0,$width-1);

$y = rand(0,$height-1);

imagesetpixel($my_image, $x, $y, 0x8e8f94);

}

$x = rand(1,10);

$y = rand(1,10);

$rand_string = rand(1000,9999);

imagestring($my_image, 5, $x, $y, $rand_string, 0x8e8f94);

setcookie(‘tntcon’,(md5($rand_string).‘a4xn’));

imagejpeg($my_image);

imagedestroy($my_image);

?>

$inputVerifBox = strip_tags($_POST[‘verif_box’]);

…that’s just something I added to try it out. I would like someone who can figure out how I can get this image verification to work along with the codes please.

Done, try it now:
http://www.leecraigstewart.com/#contact

I’ve left the verif_box blank and filled in the other fields and then submit, nothing shows up.

replace the whole function validateVerifBox()…


function validateVerifBox($inputVerifBox) {
    $out = true;
    
    if (strlen($inputVerifBox) === 0 || md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = false;
    
    return $out;
}

When I do not enter the verification code nothing happens, but when I put in the verification image number it sends, how would I change the css/js to make it mention ‘no verification was entered’ and ‘invalid verification code’ for example.
You’ll notice for example that when you enter an email address without the @ and service provider, it recognises it as an invalid email address and the box turns red and if I could only get the same with ‘no verification was entered’ then that’d be swell.

http://www.leecraigstewart.com/#contact

Thanks.

replace below line…


if (strlen($inputVerifBox) > 0 && md5($inputVerifBox.'a4xn') !== (string)$_COOKIE['tntcon']) $out = true;

with this corrected one…


if (strlen($inputVerifBox) > 0 && md5($inputVerifBox.'a4xn') === (string)$_COOKIE['tntcon']) $out = true;

Where’s your function validateVerifBox() within contact.php?