Return to Snippet

Revision: 60107
at October 20, 2012 14:59 by o0110o


Initial Code
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { define("PROTOCOL", "https://");} // DEFINE PROTOCOL
else { define("PROTOCOL", "http://"); }
define("WEBROOT_URL", PROTOCOL.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])); // DEFINE WEBROOT PATH

Initial URL

                                

Initial Description
Get the absolute webroot URL.

Initial Title
Get the absolute webroot URL.

Initial Tags
php, path, server

Initial Language
PHP