Header response "403 Forbidden" with cURL, file_get_contents() and fopen()
<p>I'm hoping you'll be able to help me.
The site is currently online and I can access it fine, I can't seem to understand why this isn't working.</p>

<p><code>file_get_contents()</code> and <code>fopen()</code> return an error saying the following:</p>

<pre class="lang-none prettyprint-override"><code>PHP Warning:  file_get_contents(http://www.hackforums.net): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /host/Users/Phizo/Desktop/stalker.php on line 29
</code></pre>

<p>Now I just started taking up cURL since I wanted to try get around this 403, also no luck.</p>

<pre class="lang-php prettyprint-override"><code>$handle = curl_init();
$file = fopen('source.txt', 'w');

curl_setopt($handle, CURLOPT_URL, 'http://www.hackforums.net/');
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($handle, CURLOPT_HEADER, true);
curl_setopt($handle, CURLOPT_AUTOREFERER, true);
curl_setopt($handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1');
curl_setopt($handle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($handle, CURLOPT_FILE, $file);

curl_exec($handle);

print_r(curl_getinfo($handle));

curl_close($handle);
fclose($file);
</code></pre>

<p>Outputs the following error:</p>

<pre class="lang-none prettyprint-override"><code>Fatal error: Maximum execution time of 30 seconds exceeded in D:\Hosting\6514439\html\zeonsglobal\admin\press_uploads\stalker.php on line 29
</code></pre>
