Attempt to get HTML from website using PHP cURL does not work
<p>I am attempting to write a script that can retrieve the HTML from my school's schedule search webpage. I am able to visit the web page normally when I visit it using a browser, but when I try to get it to work using cURL, it gets the HTML from the redirected page. When I changed the </p>

<pre><code>CURLOPT_FOLLOWLOCATION
</code></pre>

<p>variable from true to false, it only outputs a blank page with the headers sent. </p>

<p>For reference, my PHP code is</p>

<pre><code>&lt;?php
$curl_connection = curl_init('https://www.registrar.usf.edu/ssearch/');

curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($curl_connection, CURLOPT_HEADER, true);
curl_setopt($curl_connection, CURLOPT_REFERER, "https://www.registrar.usf.edu/");

$result = curl_exec($curl_connection);

print $result;

?&gt;
</code></pre>

<p>The website that I am trying to get the HTML of from cURL is <a href="https://www.registrar.usf.edu/ssearch/" rel="nofollow">https://www.registrar.usf.edu/ssearch/</a> or <a href="https://www.registrar.usf.edu/ssearch/search.php" rel="nofollow">https://www.registrar.usf.edu/ssearch/search.php</a></p>

<p>Any ideas? </p>
