亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

執行后的 PHP Curl 不返回 Ajax 請求

執行后的 PHP Curl 不返回 Ajax 請求

PHP
慕斯王 2022-12-11 09:59:38
我正在集成一個 PHP 代碼來將站點地圖 ping 到谷歌和 Bing。代碼執行完美,但如果我從 ajax 調用發起請求,那將是事實。它不會返回下面是我用來進行 ajax 調用的 Jquery 代碼$("body").on('click', 'button#sitemap_google_submit', function(event){    toastr.info("Would require few seconds, Please wait, do not refresh Page..",                "Submitting Sitemap to Google!",                {   progressBar:!0,                    showMethod:"slideDown",                    hideMethod:"slideUp",                    timeOut:2e3,                    preventDuplicates: true,                    positionClass: "toast-bottom-right"                }            );    $("button#sitemap_google_submit").attr("disabled", true);    $("button#sitemap_google_submit").html("<i class='ft-loader spinner'></i> &nbsp;Submitting to Google..");    $.ajax({            url: '/bypasser/modules/seoController.php',            type: 'POST',            dataType: 'JSON',            data: {type: 'submit', console: 'google'},        })        .done(function(resp) {            $("button#sitemap_google_submit").attr("disabled", false);            $("button#sitemap_google_submit").html("<i class='fa fa-google fa-lg'></i> &nbsp;Submit to Google");            toastr[resp.type](resp.message,                               resp.heading,                    {   showMethod:"slideDown",                        hideMethod:"slideUp",                        preventDuplicates: true,                        positionClass: "toast-bottom-right"                    });        });    });JSON 編碼在檢查元素的網絡選項卡的預覽面板中完美顯示,但不知何故它不返回對 ajax 的響應,這是什么問題?
查看完整描述

1 回答

?
SMILET

TA貢獻1796條經驗 獲得超4個贊

curl_setopt($ch, CURLOPT_HEADER , false);  // we don't want headers

代替

curl_setopt($ch, CURLOPT_HEADER , true);  // we want headers

我們也不需要標頭,據我了解您的問題,您可能只是在尋找 ping 狀態代碼!


查看完整回答
反對 回復 2022-12-11
  • 1 回答
  • 0 關注
  • 141 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號