Last active
February 6, 2018 15:20
-
-
Save KaiserWerk/704a28ef1f1be30f71aff3e7693065cb to your computer and use it in GitHub Desktop.
A function for checking the current page call happened via SSL or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isSSL() { | |
if (isset($_SERVER['HTTPS']) ) { | |
if (!empty($_SERVER['HTTPS'])) { | |
return true; | |
} | |
if (strtolower($_SERVER['HTTPS'] === "on") { // for IIS | |
return true; | |
} | |
} elseif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment