Jump to content

calling curl repeatedly error


ansharma

Recommended Posts

Hi all

 

i am trying to use curl function recursively but when the function first execute it get the content but next time it give the following error

Protocol http not supported or disabled in libcurl

 

$url = "http://www.example.com";
pager($url);

function pager($url){
        $urlArray = array();
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $result = curl_exec($ch);
echo curl_error($ch);

        // code to get url from result
        // i get an array here $urlArray 

        curl_close($ch);

        foreach($urlArray as $value){
		$urlval = urlget($value);
		if($urlval)
		{
		$urlval = str_replace("href=","",$urlval);
		$urlval = str_replace("'","",$urlval);
		echo $urlval.'<br>';
		pager($urlval);
		}

        }

    }

 

Link to comment
https://forums.phpfreaks.com/topic/255126-calling-curl-repeatedly-error/
Share on other sites

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.