Jump to content

Curl Help Needed : Urgent....


phpchamps

Recommended Posts

Hi All,

 

I am facing the issue with curl. I fire the curl request on php 5.2 and if i put a invalid zip code curl sends me a blank response. However, problem is when i fire curl request on 5.1.6 version of php. I get the response as 1 (ONE).

 

Code..

$curl_handler = curl_init(); 
$options = array(
                    CURLOPT_URL            => '********', //
                    CURLOPT_RETURNTRANSFER => True,
                    CURLOPT_FOLLOWLOCATION => True,
                    CURLOPT_CONNECTTIMEOUT => 10,
                    CURLOPT_TIMEOUT        => 30,
            );
            curl_setopt_array($curl_handler, $options);
            $raw_response = curl_exec($curl_handler);
echo $raw_response;
$curl_info = curl_getinfo($curl_handler);
	curl_close($curl_handler);

 

Anybody is having any idea???

Link to comment
https://forums.phpfreaks.com/topic/202730-curl-help-needed-urgent/
Share on other sites

I have PHP 5.2 in local machine, it works fine.

 

<?php

$curl_handler = curl_init();

$options = array(

                    CURLOPT_URL            => 'http://google.com', //

                    CURLOPT_RETURNTRANSFER => True,

                    CURLOPT_FOLLOWLOCATION => True,

                    CURLOPT_CONNECTTIMEOUT => 10,

                    CURLOPT_TIMEOUT        => 30,

            );

            curl_setopt_array($curl_handler, $options);

            $raw_response = curl_exec($curl_handler);

 

 

echo $raw_response;

$curl_info = curl_getinfo($curl_handler);

curl_close($curl_handler);

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.