Jump to content

Trouble installing secure image php captcha on form


megany

Recommended Posts

Hi!

 

I've been working all day to install Secure Image to the form I'm using. The form is Jack's Formmail. I followed all of the instructions on the website and used the code in the instructions found on the website for the form processor:

 

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
  // the code was incorrect
  // handle the error accordingly with your other error checking

  // or you can do something really basic like this
  die('The code you entered was incorrect.  Go back and try again.');
}
    

 

But even when I enter the code correctly, it tells me I was wrong.

 

The form I'm working on is: http://superiordisposalservice.com/Sign-up.html

 

This is the first part of the form processor file (I removed my email addresses though):

 

<?php session_start(); ?>
<?
/*
##############################################################################
# PLEASE DO NOT REMOVE THIS HEADER!!!
#
# COPYRIGHT NOTICE
#
# FormMail.php v5.0
# Copyright 2000-2004 Ai Graphics and Joe Lumbroso (c) All rights reserved.
# Created 07/06/2000   Last Modified 10/28/2003
# Joseph Lumbroso, http://www.aigraphics.com, http://www.dtheatre.com
#                  http://www.dtheatre.com/scripts/
##############################################################################
#
# This cannot and will not be inforced but I would appreciate a link back
# to any of these sites:
# http://www.dtheatre.com
# http://www.aigraphics.com
# http://www.dtheatre.com/scripts/
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
##############################################################################
*/

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
  // the code was incorrect
  // handle the error accordingly with your other error checking

  // or you can do something really basic like this
  die('The code you entered was incorrect.  Go back and try again.');
}

// for ultimate security, use this instead of using the form
$recipient = "email@email.com"; // youremail@domain.com

// bcc emails (separate multiples with commas (,))
$bcc = "email@email.com";

 

Thanks a million!

Link to comment
Share on other sites

I looked up four more captcha scripts and tried installing each of them...and all of them failed. Every time I get the message that says the code is incorrect.

 

What am I doing wrong? I promised this company, which belongs to a friend of the family, that I would have their captcha installed and working by the end of this afternoon and instead their form has been down for hours because I haven't been able to get it work. I'm trying...all of the tutorials looked so simple. They only had two or three steps.

 

Thanks again,

Link to comment
Share on other sites

Looking earlier on your form, I saw the captcha but didn't have time to reply.

 

What I think is happening, is every time you submit the form you are calling to create a new security image, thus creating a new security code & making the one the user saw invalid:

$securimage = new Securimage();

 

When you read through this tutorial, you might understand it better (notice the session key vs post value?):

http://www.codewalkers.com/c/a/Miscellaneous/Creating-a-CAPTCHA-with-PHP/

 

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.