Page 1 of 1

CURL question

Posted: Mon Dec 11, 2006 9:59 am
by Hesky
Hi,

I'm trying to use cURL to get the contents of a website.

I'm testing an example provided by godaddy (my host). Now for some reason it seems to work with every URL I've tested it with, except one (unfortunately, the one I need): http://www.whl.ca/hm/ <With this webpage all I get is a blank page (a timeout error I think).

Every other URL I have tested works justs fine.

Here's the code:

Code: Select all

<?

$URL="https://www.paypal.com";
if (isset($_GET["site"])) { $URL = $_GET["site"]; }
$ch = curl_init();
echo "URL = $URL <br>\n";
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY,"http://proxy.shr.secureserver.net:3128");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
echo "<hr><br>\n";
echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';
echo "<hr><br>\n";
curl_close ($ch);
print "result - $result";
echo "<hr><br>\n";

?>
Any help would be greatly appreciated...and sorry for my poor English.

Posted: Mon Dec 11, 2006 10:01 am
by thiscatis
if you wrap your code round [ php ] code [ / php ] tags it will be easier to read by the members here

Posted: Mon Dec 11, 2006 10:03 am
by Hesky
thiscatis wrote:if you wrap your code round [ php ] code [ / php ] tags it will be easier to read by the members here
Done, thanks and sorry.