Hi I have a piece of code on the client as follows:
<?php
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://xx.xx.xxx.xxx:9000/postpara.php', //xx.xx.xxx.xxx is the public ip
CURLOPT_USERAGENT => 'Codular Sample cURL Request',
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => array(
item1 => 'value',
item2 => 'value2'
)
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
echo $resp;
?>
My server code sits behind a proxy server, with the local ip = "192.168.12.23". I have done the port forwarding and the public IP xx.xx.xxx.xxx:9000 correctly points to the local ip. However I am unable to get any response from this server code. server Code is as follows:
<?php
$items1 = $_POST["item1"];
$items2 = $_POST["item2"];
print($items1 . $items2);
?>
I have tested this on a different server and it gives me output as expected. Is there any problem the proxy is creating?