Returning http/https protocol
<p>I've the following code which I got from somewhere and it doesn't appear to be working: </p>

<pre><code>function http() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 return $http;
}
</code></pre>

<p>Can someone help?</p>

<p>What I am attempting to do is return the website protocol when I type in $http</p>

<p>ex:</p>

<pre><code>&lt;a href="&lt;?php echo $http . $websiteurl .'/index.php' ?&gt;"&gt;Website URL including Protocol&lt;/a&gt;
</code></pre>

<p>I've got the $websiteurl down, I just can't seem to get it to echo http vs https.  I don't know much about functions, so I'm not sure how to troubleshoot it.</p>
