DarkBy adlı üyeden alıntı: mesajı görüntüle
arkadaşlar merhaba örneğin bir sitede resim içinde yazıların olduğunu düşünelim ve bunu inputa girilmesini istiyor klasik bot kontrol mantığı. Ben curl ile login için post göndereceğim fakat captcha yı nasıl geçebileceğimi bulamadım bunun hakkında bir önerisi olan var mı acaba?
Google recaptha keyiniz olduğunu var sayarak yazıyorum.
Giriş Sayfası
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Giriş Yap</title>
 <script src="https://www.google.com/recaptcha/api.js?hl=tr"></script>
</head>
<body>
      <form id="giris" action="recaptcha.php" method="post">
      <input type="email" placeholder="E-Postanız" size="40"><br><br>
      <input type="password" placeholder="Şifreniz" size="40"><br><br>
      //google recaptcha api sayfasında formumuza eklememiz gereken elemenı bize veriyor
      <div class="g-recaptcha" data-sitekey="=== Site key ==="></div>
      <input type="submit" name="submit" value="Giriş Yap"><br><br>
    </form>
 
</body>
</html>
Kontrol Sayfası
if ($_POST) {
  if (isset($_POST['email'])) {
      $email = $_POST['email'];
  }
  if (isset($_POST['password'])) {
      $yorum = $_POST['password'];
  }
  if (isset($_POST['g-recaptcha-response'])) {
      $captcha = $_POST['g-recaptcha-response'];
  }
  if (!$captcha) {
      echo '<h2>Lütfen robot olmadığınızı doğrulayın.</h2>';
      exit;
  }
  $control = reCaptchaControl($captcha);

  if ($control.success == false) {
      echo '<h2>Spam Gönderi!</h2>';
  } else {
      echo '<h2>Giriş Başarılı Yönlendiriliyorsunuz.</h2>';
      header("Refresh:3; url=index.php");
  }
}

function reCaptchaControl($captcha){
  $fields = [
          'secret' => 'GOOGLE_RECAPTCHA_SECRET_KEYINIZ',
          'response' => $captcha
        ];
        $ch = curl_init('https://www.google.com/recaptcha/api/siteverify');
        curl_setopt_array($ch,[
           CURLOPT_POST => true,
           CURLOPT_POSTFIELDS => http_build_query($fields),
            CURLOPT_RETURNTRANSFER => true
        ]);

        $result = curl_exec($ch);
        curl_close($ch);
        return json_decode($result,true);
}