Get the absolute webroot URL.
Get the absolute webroot URL.
Copy this code and paste it in your HTML
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
Report this snippet