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.';
}
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.