cURL and IP Addresses
Posted: Wed Apr 29, 2009 5:25 am
Hello,
I am having trouble posting form data to a remote script using cURL where the script is located via an IP address. This is what I'm trying to do which is currently not working:
However if I try a similar thing with an actual domain name, i.e same code as above but change $url to http://www.mydomain.com/scripts/myscript.py it works fine. Any ideas why this might not be working?
Thanks.
I am having trouble posting form data to a remote script using cURL where the script is located via an IP address. This is what I'm trying to do which is currently not working:
Code: Select all
$url = "http://xxx.xxx.xx.xxx:xxx/scripts/myscript.py";
$args = "username=".urlencode($user['username']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$args);
$result= curl_exec ($ch);
curl_close ($ch);Thanks.