I am using php curl to make a http get long polling request from my javascript using Ajax. Here is the call from javascript
var i;
i++;
$.ajax({
url:"http://localhost/myport.php",
type: GET,
success: function(response){ ...},
...
...
Here is how I make the php call in the myport.php file
<?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
If I making the call directly from js, I would do
$.ajax({ url:"http://localhost:7555/test?index=" + i
I am new to php and curl, I am wondering how I can pass the value of that variable so I can get a parameter for the call.