Documentation

IsHTTPS

bool
CMain::IsHTTPS()

The method determines if the current protocol is secured (HTTPS). Static method.

Parameters

No parameters.


Example of use

<?
global $APPLICATION;
// get the full URL of the current page 
$CURRENT_PAGE = (CMain::IsHTTPS()) ? "https://" : "http://";
$CURRENT_PAGE .= $_SERVER["HTTP_HOST"];
$CURRENT_PAGE .= $APPLICATION->GetCurUri();
// $CURRENT_PAGE may contain, 
// "http://www.mysite.com/en/index.php?id=23"
?>


© «Bitrix24», 2001-2022
Up