1
0

Use http:// or https:// in URLs based on URL of current page

This commit is contained in:
2014-01-23 23:08:42 -05:00
parent b80db8db05
commit 3793bac300
21 changed files with 110 additions and 58 deletions

11
common.php Normal file
View File

@ -0,0 +1,11 @@
<?php
function get_protocol() {
$protocol = "http";
if ( (!empty($_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443) )
$protocol = "https";
return $protocol."://";
}
$protocol = get_protocol();
$base_url = $protocol.$_SERVER['HTTP_HOST'];
?>