I have checked all the postings of everything I could and found no solutions to my issue. And unfortunately I am quite new to php so my knowledge is pretty slim. Therefore I pose my question:
Given the following code, why is the page blank when it should be echo'ing either the curl_error or $content?
<?php
$url = "http://thenewboston.org/";
function curl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
echo curl_error($ch);
curl_close($ch);
return $data;
}
$content = curl_get_contents( $url );
echo $content;
?>
This not the specific URL I need to connect to howver at the moment I am not able to pull data from any URL I try.
Thanks.
echo 'curl Extension is: '.( function_exists('curl_version') ? 'present' : 'not installed or disabled');to your scripterror_reporting(E_ALL);in the beginningerror_reporting(E_ALL);with no result :Pfile_get_contents()? Does your server havefopen_urldisabled?