Jump to content

image verification on contact form, pop up window on incorrect code entry


con

Recommended Posts

This page works just fine http://www.houseofspeed.com.au/coz/contactus.html

Here is the PHP that checks the code.

You can see where it checks and then says yes its OK and then runs the contact.php file

I am curious to know when it fails can there be a pop up window stating that the code was wrong and they should try again. While all this is happening I dont want the user to leave the contactus.html page and then also have to re-enter their info.

 

At the moment if it fails it just throws up and quick echo from this php file and then you have to click back, although your info is still there I don't want the user to leave the site.

<?php
include_once 'common.php';

if(isSet($_POST['security_code']))
{
$security_code = trim($_POST['security_code']);

$to_check = md5($security_code);

if($to_check == $_SESSION['security_code'])
{
include_once('contact.php'); 
}
else
{
echo 'The security code is <font color="red">incorrect</font>. <br /><br />Please go back and try again.';
}
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.