I've the following code which I got from somewhere and it doesn't appear to be working:
function http() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
return $http;
}
Can someone help?
What I am attempting to do is return the website protocol when I type in $http
ex:
<a href="<?php echo $http . $websiteurl .'/index.php' ?>">Website URL including Protocol</a>
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.