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



Reply With Quote


Bookmarks