sm Posted April 21, 2008 Share Posted April 21, 2008 Hai , I'm trying to get xml data from another server.Here is the code i uSed. It's working fine in local but getting php output as "BAD REQUEST" when I upload in my server. $ip = $HTTP_SERVER_VARS["REMOTE_ADDR"]; function send($url1, $data1) { $header = array ("POST /XML/XMLSearch HTTP/1.1","Content-Type: text/xml"); //Set up the CURL..... $ch = curl_init($url1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); // curl_setopt($ch, CURLOPT_POSTFIELDS, $data1); $result1 = curl_exec($ch); curl_close ($ch); return $result1; } $content='YJzQxX6l&l=&i=0&n=2&tl=2&ip=$ip&lf=0&af=1&cat=health insurance'; $url="http://api.ingenio.com/YJzQxX6l/GetListings.asmx/lq?a=YJzQxX6l&l=&i=0&n=2&tl=2&ip=$ip&lf=0&af=1&cat=health insurance"; $response_content=send($url,$content); print $response_content; Any soiution is appreciated Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/102094-regarding-curl/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.