isset($_SERVER['HTTPS']) |
[eluser]theshiftexchange[/eluser]
Hi everyone, I've recently started using the piece of code below to define my base url: Code: $config['base_url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://' ; My question is: where is $_SERVER['HTTPS'] defined?
[eluser]tonanbarbarian[/eluser]
as the name suggests all $_SERVER variables are provided by the webserver
[eluser]Shay Falador[/eluser]
The whole $_SERVER global-array is defined by PHP itself. The HTTPS is defined and contains on if the page is accessed by https protocol (e.g. https://www.domain.com/ will set it on, http://www.domain.com/ won't). You can read more about $_SERVER global-array in php.net web site. |
Welcome Guest, Not a member yet? Register Sign In |