我正在使用PHP卷曲使HTTP使用Ajax从我的JavaScript获取长轮询请求。这是从JavaScript从JavaScript传递动态参数通过AJAX在cURL调用
var i;
i++;
$.ajax({
url:"http://localhost/myport.php",
type: GET,
success: function(response){ ...},
...
...
这里呼叫我如何让PHP调用在myport.php文件
<?php
$ch=curl_init();
$curl_setopt($ch, CURLOPT_URL, "http://localhost:7555/test?index=" //Here I need to set a value (the variable i) in the above JS
如果我直接从爵士打出电话,我会做
$.ajax({ url:"http://localhost:7555/test?index=" + i
我是新来的PHP和卷曲,我想知道如何传递该变量的值,所以我可以得到一个参数的调用。
如果我不清楚,我很抱歉。我想从Javascript获取curl调用的参数。我怎样才能做到这一点?正如我所展示的,ajax调用了php,然后调用http get请求。 –