Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: Using another php script fo imgverify

  1. #11
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Thanks crabtree,

    I use v8.11 with .ini (if this can help analyze the issue).

    I also tried Secure Image captcha. But the same issue as the white cap.

    "moving that asame code to the hook file makes no difference. if ur seeing a difference then u havent done it right."
    Inside the formmail I used the code as you suggested:

    //
    // 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();

    And in the fmhooks, I used it as:

    <?php
    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");
    }
    ?>

    I named the the file inside the fmhooks directory as: fmhookpostinit.inc

    Inside the html I have:

    <tr>
    <td valign="top">

    &nbsp;&nbsp;<img src="http:/mysite/fmmailCaptchaSecurityImages.php?width=100&height=40&characters=5"><br>


    </td>
    <td><input class="formbox" id="security_code" name="security_code" type="text" size="9" maxlength="6"> *
    </td>
    </tr>


    but y not just use one of the captcha's the tectite already supports?
    Just curiosity, secondly, the tectite captcha hasn't been updated for some time now.

    Thanks again for your time and help.
    --tp



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

    Default Re: Using another php script fo imgverify

    did u move the code or just make a copy?

    if ur running that white cap logic twice (in formmail and the hook file) then that would explain the problem


    Just curiosity, secondly, the tectite captcha hasn't been updated for some time now.
    no need to update something that works is there?

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

    Default Re: Using another php script fo imgverify

    Quote Originally Posted by Tomcatt View Post
    Ok. I've just seen many replies that do not give much of answer to people truly trying to find their way

    ....

    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
    hey, i went to a fair amount of effort to give u this "recipe".

    have u gone away or r u just delayed in replying?

    has it worked for u?

  4. #14
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Hi crabtree,

    Thank you very much for your help and promptness. I was away from my computer for a few hours. Sorry for not being prompt in my response to your great help.

    "did u move the code or just make a copy?"
    First as you suggested I tried inside, the I moved the code into the file in fmhooks directory.

    Thanks again.

    -tp

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

    Default Re: Using another php script fo imgverify

    I was away from my computer for a few hours. Sorry for not being prompt in my response to your great help.
    my last comment was for the orig poster (TommCat) not u.

    First as you suggested I tried inside, the I moved the code into the file in fmhooks directory.
    so, u deleted the added code from formmail, update ur server and everything, right?

    moving the code to a hook file will make no different to its operation.

    wot ur describing suggests u still have the added code in formmail as well as in the hook file.

  6. #16
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Hi crabtree,

    Thank you very much for you quick response and help.

    "so, u deleted the added code from formmail, update ur server and everything, right?

    moving the code to a hook file will make no different to its operation.

    wot ur describing suggests u still have the added code in formmail as well as in the hook file."

    Yes - I deleted the code from the formmsil. I just double checked, the only place the code appear is in the fmhooks directory.

    --tp

  7. #17
    Join Date
    May 2008
    Posts
    5

    Default Re: Using another php script fo imgverify

    Hey.
    I was away for a few days. I just inserted the code and made a few changes to the forms and works perfectly. Is it necessary to create a hook file or can I just leave the code in the script?

    BTW I'm using version 8.05. Should I upgrade?

    Thanks for the help. It sure is nice to know people like you are willing to help!

    One other question (if you can help). When I return to the form (if errors) the file upload field is blank. Is this normal or did I miss something?

  8. #18
    Join Date
    Dec 2008
    Posts
    28

    Default Re: Using another php script fo imgverify

    Hi Tomcatt,

    "I just inserted the code and made a few changes to the forms and works perfectly. "

    I am also interested in this. Kindly could you please post the final working code. I will really appreciate. Thanks.

    -tp

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

    Default Re: Using another php script fo imgverify

    Quote Originally Posted by Tomcatt View Post
    Hey.
    I was away for a few days.
    cool...wondered where u got to!

    I just inserted the code and made a few changes to the forms and works perfectly. Is it necessary to create a hook file or can I just leave the code in the script?
    u can leave the code, but u need to remember its there when u upgrade formmail in the future and u will need to put it back each time

    also, it might need to go in a different place after an upgrade.

    in a hook file u won't need to worry about upgrades

    BTW I'm using version 8.05. Should I upgrade?
    yes! i think tectite fixed their 3rd bug in 5 years in version 8.11 (i wish some other companys had so few bugs)


    One other question (if you can help). When I return to the form (if errors) the file upload field is blank. Is this normal or did I miss something?
    yes, its security in the browser (all browsers) and there's no way round it.

  10. #20
    Join Date
    May 2008
    Posts
    5

    Default Re: Using another php script fo imgverify

    I am also interested in this. Kindly could you please post the final working code. I will really appreciate. Thanks.

    -tp
    I followed the instructions that Crabtree left. First get it working. That is, use the form.php from white-hat and make sure you get that working. You need to upload the font.ttf, the captchasecurityimages.php and the form.php. Modify the form.php to reflect your domain or use it directly from your server. (you can't use a local copy unless you update the form.php to include your domain in the form as I've done in the code below)

    Code:
        <form action="http://YOURDOMAIN.com/form.php" method="post">
            <label for="name">Name: </label><input type="text" name="name" id="name" /><br />
            <label for="email">Email: </label><input type="text" name="email" id="email" /><br />
            <label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br />
            <img src="http://YOURDOMAIN.com/CaptchaSecurityImages.php?width=100&height=40&characters=5" /><br />
            <label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br />
            <input type="submit" name="submit" value="Submit" />
        </form>
    Once you get that working then you can modify the formmail.php as crabtree suggested. I did it without creating an external file (hook file) just to test it and it works perfectly. Simply add the code as he explained it.

    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 **/
    If you still can't get it to work your problem may be in the form itself. Try starting with something simpler or (I hate to say it) try starting over with a new form.

    I hope I've been of some help.

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
  •