Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: Using another php script fo imgverify

  1. #1
    Join Date
    May 2008
    Posts
    5

    Default Using another php script fo imgverify

    I wanted to use a different php script from another source for image verify.(http://www.white-hat-web-design.co.u...hp-captcha.php)
    I can get the image to appear but formmail claims that the image doesn't match the text entered even though it does. Formmail works fine when using the verifyimg.php but gives the error when using php-captcha.php. What am I missing here?

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Using another php script fo imgverify

    logic is required in formmail for the captcha program ur using

    unless u really know wot ur doing, u wont be able to make the changes to formmail to suport this other captcha u want

  3. #3
    Join Date
    May 2008
    Posts
    5

    Default Re: Using another php script fo imgverify

    y wood you assume i dont know wot im doing?
    iz it cuz i cant spell like u?
    i hope sum 1 can reply wit a reel anser

  4. #4
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Using another php script fo imgverify

    unless u really know wot ur doing
    no offense intended...i just meant that u need to be a php programmer to get other captchas working with tectite formmail

  5. #5
    Join Date
    May 2008
    Posts
    5

    Default Re: Using another php script fo imgverify

    Ok. I've just seen many replies that do not give much of answer to people truly trying to find their way. As for me, I've been writing HTML since the early '90s and PERL almost as long. (Though I've never really actually written a PERL script from scratch thanks to the wonderful community of open source ... thanks Selena).

    I'm no expert at PHP (yet) but I haven't had any trouble finding my way around it. Hell, I used to configure procmail. Remember procmail? Got any good recipes?

    If you've got a suggestion I'm willing to give it a try

    Thanks for responding.

  6. #6
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Using another php script fo imgverify

    ok i took at look at the white hat captcha site u mentioned

    it says to put this in the form processor:
    PHP Code:
    <?php 
       session_start
    ();
       if((
    $_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
          
    // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
          
    unset($_SESSION['security_code']);
       } else {
          
    // Insert your code for showing an error message here
       
    }
    ?>
    so, i'd do this in two steps:
    1. get it working
    2. move it to a hook file (u want to do this so u can upgrade formmail latr without having to re-do the changes)
    first, forget the session_start....formmail already does that

    using version 8.11, look for:
    PHP Code:
    @include("$HOOK_DIR/fmhookload.inc"); 
    around line 10072

    thats inside an if - forget that fact

    b4 the // line that follows shortly, add the captcha checking code.

    so, the code before is:
    PHP Code:
       //
        // Hook system: after initialization
        //
    if ($HOOK_DIR !== "")
        if (!@include(
    "$HOOK_DIR/fmhookpostinit.inc.php"))
            @include(
    "$HOOK_DIR/fmhookpostinit.inc");
        
    //
        // check configuration values for potential security problems
        //
    CheckConfig(); 
    and after it is:

    PHP Code:
       //
        // Hook system: after initialization
        //
    if ($HOOK_DIR !== "")
        if (!@include(
    "$HOOK_DIR/fmhookpostinit.inc.php"))
            @include(
    "$HOOK_DIR/fmhookpostinit.inc");
     
    /***CODE ADDED **/
    if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
          
    // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
          
    unset($_SESSION['security_code']);
       } else {
          
    // Insert your code for showing an error message here
          
    UserError("captcha_fail","Your input didnt match");
       }
    /***END OF CODE ADDED **/
        //
        // check configuration values for potential security problems
        //
    CheckConfig(); 
    u see i also added the UserError call to handle the error

    test.

    once it works, u can move to a HOOK file.

    just create a dir and put its path in $HOOK_DIR in the config section.

    then move the added captcha checking code into a file called "fmhookpostinit.inc.php" in that dir.

    i havent tested the above but it should work

    u could even contact tectite and ask them to add support for this white hat captcha

  7. #7
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Hi dear,

    I am also interested in this.

    I tried as you suggested. But i get the error message for the line which is below the bottom of the page, below the last ?> !!!!

    I also tried in the fmhooks suggestion, that did not work either - It keeps telling me i need to enter the code, even if I enter the correct code!!

    Any more suggestion please?

    Thanks.

    t-p

  8. #8
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Using another php script fo imgverify

    Quote Originally Posted by t-p View Post
    I tried as you suggested. But i get the error message for the line which is below the bottom of the page, below the last ?> !!!!
    ok, i just tried wot ive posted in a copy of my formmail, and it's fine.

    i guess u must have made a mistake

    u have to be careful modifying code.

    I also tried in the fmhooks suggestion, that did not work either - It keeps telling me i need to enter the code, even if I enter the correct code!!
    get it working inside formmail first b4 trying the ini file.

  9. #9
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Hi crabtree,

    $REQUIRE_CAPTCHA = "";

    Now the required fields are checked and the mail is sent.
    BUT, I noticed the following behavior:

    1. code inside the formmail:

    iused code as follows:

    //
    // Hook system: after initialization
    //
    if ($HOOK_DIR !== "")
    if (!@include(
    "$HOOK_DIR/fmhookpostinit.inc.php"))
    @include(
    "$HOOK_DIR/fmhookpostinit.inc");

    /***CODE ADDED **/
    if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
    // Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
    unset($_SESSION['security_code']);
    } else {
    // Insert your code for showing an error message here
    UserError("captcha_fail","Your input didnt match");
    }
    /***END OF CODE ADDED **/
    //
    // check configuration values for potential security problems
    //
    CheckConfig();


    Error: it keeps saying "An error occurred while processing the form .

    Your input didnt match"

    2. Code inside the fmhooks:

    Error: it does check if the captcha input is there. But even if the string is wrong the email is sent.

    what I might be doing wrong?

    Thanks again for your help.

    -tp

  10. #10
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Using another php script fo imgverify

    maybe the white hat doesn't work.

    i dunno

    moving that asame code to the hook file makes no difference. if ur seeing a difference then u havent done it right.

    if i get a chance i'll download the white hat code and see if i can get it to work.

    but y not just use one of the captcha's the tectite already supports?

    verifyimg (free) or captcha creator (not free)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Script Works, Email Contains No Information
    By JakeForest in forum FormMail Subscription Support
    Replies: 10
    Last Post: 28-Dec-2005, 10:51 PM
  2. Thanks for the great script, but I am having issues...
    By darknightjedi in forum FormMail Subscription Support
    Replies: 12
    Last Post: 26-Aug-2004, 08:08 PM
  3. FormMail Script Error Message
    By rose in forum FormMail Subscription Support
    Replies: 2
    Last Post: 27-Jun-2004, 04:59 AM
  4. DEF_ALERT setup in script - Don't understand
    By jodmcc in forum FormMail Subscription Support
    Replies: 2
    Last Post: 17-Jun-2004, 07:02 AM
  5. Great script but.....
    By Remosz in forum FormMail Subscription Support
    Replies: 3
    Last Post: 23-Mar-2004, 10:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •