Why does this code return a null string for a XenForo site (main forum index)? I've tried it with several of my XenForo sites, works fine w/ sites handled by HTML, PERL & other PHP scripts.
It displays "0", not "cURL failed".
It displays "0", not "cURL failed".
PHP:
<?php
// create a new cURL resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://my xenforo site");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$data = curl_exec($ch);
curl_close($ch);
if ($data === false)
{
echo 'cURL failed';
exit;
}
echo strlen($data);
?>