Results 1 to 2 of 2

Thread: Help needed about recaptcha in php

  1. #1
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help needed about recaptcha in php

    I am creating a website in joomla. My problem is that I don't know much more of php and I am learning . In my website's registration page i want to put a recaptcha. I asked for forum help in joomla no one able to tell me what will be the exact procedure. I treied by my self and and almost able to finish it. But I stuck on last step. I write code in my registration form by the help of google api
    <action="verify.php">
    <?php
    require_once('/recaptchalib.php');
    $publickey = "my public key"; // you got this from the signup page
    echo recaptcha_get_html($publickey);
    ?>
    <button class="button validate" type="submit"><?php echo JText::_('Register'); ?></button>
    <input type="hidden" name="task" value="register_save" />
    <input type="hidden" name="id" value="0" />
    <input type="hidden" name="gid" value="0" />
    <?php echo JHTML::_( 'form.token' ); ?>


    </form>

    Which is diverting on verify.php. and the verify.php is like
    <?php

    require_once('recaptchalib.php');
    $privatekey = "my private key";
    $resp = recaptcha_check_answer ($privatekey,
    $_SERVER["REMOTE_ADDR"],
    $_POST["recaptcha_challenge_field"],
    $_POST["recaptcha_response_field"]);

    if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
    "(reCAPTCHA said: " . $resp->error . ")");
    }
    else
    {

    }
    // Your code here to handle a successful verification

    ?>


    Now my problem is that I am unable to complete the registration and return all values. I have tid by giving command return but It's not working. Can any one help me?

    Abhijit

  2. #2
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Dear there,

    Hi,

    Please send me your registration form full code, and let see what i do for you

    Regards,

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
  •