【问题标题】:passing google RecaptchaResponsed via curl php通过 curl php 传递 google RecaptchaResponsed
【发布时间】:2020-01-23 03:59:40
【问题描述】:

如何手动在网站上发布 curl 登录并使用 google 重新捕获 它不起作用它说localhost不支持

这是代码

global $curl;


    $link = "https://localhost.com/my-account/";
    $s = $curl->get($link, 0);
    $woocommerceloginnonce = get_string_between($s, 'woocommerce-login-nonce" value="', '"');
    $post = array(
        '_wp_http_referer' => 'https://localhost.com/my-account/',
        'g-recaptcha-response' => $gRecaptchaResponsed,
        'login' => 'Log in',
        'password' => '!$%!@#',
        'username' => 'something@example.com',
        'woocommerce-login-nonce' => $woocommerceloginnonce
    );
    $headers = array(
        "Upgrade-Insecure-Requests: 1",
        "Content-Type: application/x-www-form-urlencoded",
        "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
        "Sec-Fetch-User: ?1",
        "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
        'referer: https://localhost.com/my-account/'
    );
    $curl->header($headers);
    echo  $s = $curl->post($link, json_decode($post), 0, 1, 0);

我有一个 curl 课来做 curl 的工作 那么我怎样才能通过它并转到我的帐户,我有谷歌 recapte 回应 或者我怎样才能用js代码做到这一点

【问题讨论】:

    标签: javascript php curl


    【解决方案1】:

    默认情况下不再支持 localhost 域。如果你想 继续支持他们的发展,您可以将他们添加到列表中 您的站点密钥支持的域数。转到管理控制台 更新您支持的域列表。我们建议使用单独的密钥 用于开发和生产,并且不允许 localhost 在您的 生产站点密钥。

    但你可以将它们添加到谷歌管理控制台

    https://developers.google.com/recaptcha/docs/faq#localhost_support

    【讨论】:

      猜你喜欢
      • 2015-04-02
      • 2014-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-22
      • 2017-10-25
      • 2016-03-19
      相关资源
      最近更新 更多