How would I use this code below to output either normal http: or https depending on the current browsing window's security..
function secureConnection()
{
if (isSet($SERVER['HTTPS']))
return (0 == strcmp(strtolower($SERVER['HTTPS']), 'on')) ? TRUE : FALSE;
else
return FALSE;
}
basically, Im trying to put a piece of code
(webpage, image, js) etc..
on my project websites, that I would host on another server with SSL.
My client sites can be using SSL and non-SSL pages
example:
if SSL{
include('https://www.mysecure-site.com/client1-SSL.php');
} else
{
include('http://www.mysecure-site.com/client1-nonSSL.php');
}
I have searched and found additional code but the above seems to be favoured over the likes:
if(isset($SERVER['HTTPS']) && $SERVER['HTTPS']=='on') {
echo 'you are secure(SSL)';
}
###
if ($_SERVER['SERVER_PORT'] == 443) {
echo "HTTPS";
}
###