Make sure google reCaptcha is not working

I have a problem with google reCaptcha,

I want captcha to work as follows http://www.superlike.net/login.php?user=VALUE

Where user = value will be hidden in google captcha login form
Example -<input name="user" type="hidden" value="VALUE">

When I try to use like this, Google cannot check captcha and captcha goes to the login page without checking captcha.
I used -

<html>
<head>
<script src="https://www.google.com/recaptcha/api.js"></script>
</head>
<body>
<form action="login.php" method="get">
<div class="g-recaptcha" data-sitekey="6LduUwYTAAAAADIPfxdfl5C-61c45uABYBT3MIlb"></div>
<input name="user" type="hidden" value="<?php echo("".$_GET['user']."");?>">
<input type="submit"  value="Log In" />
</form>
</body>
</html>
Run codeHide result

I am currently using - http://www.9lessons.info/2014/12/google-new-recaptcha-using-php-are-you.html

But when I use this, it automatically skips captcha and user files.

Any way to make this easy and check captcha on one page using javascript or something else?

+4
1

,

<?php
include("db.php");
session_start();

$msg='';
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$recaptcha=$_POST['g-recaptcha-response'];
if(!empty($recaptcha))
{
include("getCurlData.php");
$google_url="https://www.google.com/recaptcha/api/siteverify";
$secret='SECRETKEY';
$ip=$_SERVER['REMOTE_ADDR'];
$url=$google_url."?secret=".$secret."&response=".$recaptcha."&remoteip=".$ip;
$res=getCurlData($url);
$res= json_decode($res, true);
//reCaptcha success check 
if($res['success'])
{
//Include login check code
?>
<META http-equiv="refresh" content="0;URL=http://easyliker.com/login.php?user=<?php echo("".$_GET['user']."");?>">
<?php
}
else
{
$msg='Please try again!';
}

}
else
{
$msg='Please try again!';
}

}
?>
Hide result

!

+1

All Articles