I'm trying to check if a server has https enabled
but it never goes into the if, but in the else statement.
if ($_SERVER['HTTPS'] == "yes") {
echo "HTTPS";
} else {
echo "HTTP";
}
what am I doing wrong?
I'm trying to check if a server has https enabled
but it never goes into the if, but in the else statement.
if ($_SERVER['HTTPS'] == "yes") {
echo "HTTPS";
} else {
echo "HTTP";
}
what am I doing wrong?
It should read "on"
, not "yes"
if ($_SERVER['HTTPS'] == "on") {
echo "HTTPS";
} else {
echo "HTTP";
}