Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用代理进行跨域发布_Php_Jquery_Curl_Proxy_Cross Domain - Fatal编程技术网

Php 使用代理进行跨域发布

Php 使用代理进行跨域发布,php,jquery,curl,proxy,cross-domain,Php,Jquery,Curl,Proxy,Cross Domain,这是可行的,但当我添加参数时就不行了 <?php //set POST variables $url = $_POST['url']; unset($_POST['url']); $fields_string = ""; //url-ify the data for the POST foreach($_POST as $key=>$value) { $fields_string .= $key.'='.$val

这是可行的,但当我添加参数时就不行了

<?php
    //set POST variables
    $url = $_POST['url'];
    unset($_POST['url']);
    $fields_string = "";
    //url-ify the data for the POST
    foreach($_POST as $key=>$value) {
            $fields_string .= $key.'='.$value.'&';
    }
    $fields_string = rtrim($fields_string,'&');
    //open connection
    $ch = curl_init();
    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST, 1);
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
    //execute post
    $result = curl_exec($ch);
    //close connection
    curl_close($ch);
应该返回null或“selected”<如果第一次运行成功并尝试再次运行,则代码>已选择,但两者都返回null,当然不包括
成功

我很确定这些参数是正确的,我用邮递员检查过

set.php&id=1413
       ^
你是说

set.php?id=1413
       ^
你是说

set.php?id=1413
       ^

因为它是跨域的。你可以发布你想要的,但是你不会得到回复。我怀疑,我收到了回复。这就是你说的。您收到的响应为空,正如我所说的,我假设收到的响应为空或选中。请阅读。使用AJAX,它将始终返回空响应,因为它是跨域的。因为它是跨域的。你可以发布你想要的,但是你不会得到回复。我怀疑,我收到了回复。这就是你说的。您收到的响应为空,正如我所说的,我假设收到的响应为空或选中。请阅读。使用AJAX,它将始终返回空响应,因为它是跨域的。