Request_IsSSL() - Is the current request SSL (HTTPS)?

This is the defacto method for determining if the current request is SSL or not.


PHP Code

function Request_IsSSL() {
	/*  
	Purpose
		Used to determine if the current request protocol is SSL.
	Return (boolean)
		Returns true if the current request is SSL (HTTPS).
		Returns false otherwise.
	Version History
		1.0 2013.06.18 Tested by Russ Tanner on PHP 5.3.10.
	*/

	return  (
			( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ) ||
			( isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' )
		);

}
 


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)