help curl_setopt( )
Posted: Tue Mar 11, 2014 11:48 am
Hello there,
I need to post some parameters to a url using curl_setopt(), but I am having some problem.
The url is
right not I am using the below code
the above will work fine but if I include port number in url it stops working.
like
I even tried adding
but still not working please help.
I need to post some parameters to a url using curl_setopt(), but I am having some problem.
The url is
Code: Select all
http://localhost:13013/XXXXXCode: Select all
<?php
//url without port number i.e http://localhost/xxxxx
//$field=xxx..
//$fields_string=xxxx….
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POST_FIELDS,$fields_string);
$result=curl_ecec($ch);
curl_close($ch);
?>
like
Code: Select all
$url=http://localhost:13013/XXXX
Code: Select all
curl_setopt($ch,CURLOPT_VERBOSE,0);
curl_setopt($ch,CURLOPT_PORT,13013);
//now url is just http://localhost/XXX