From 0c65194d4f9cf48c93eb76653cb51201d9ead370 Mon Sep 17 00:00:00 2001 From: mul91n Date: Sun, 15 Aug 2021 09:32:24 +1000 Subject: [PATCH] Add site_url() function --- index.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.php b/index.php index ccc2a23..082ae01 100755 --- a/index.php +++ b/index.php @@ -17,6 +17,17 @@ $AUTO_FILE_EXT=false; $ADMIN_EMAIL="admin@example.com"; //address for inquiries +function site_url() +{ + $url = 'http'; + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') + { + $url .= 's'; + } + $url .= '://' . $_SERVER['HTTP_HOST'] . '/'; + return $url; +} + // generate a random string of characters with given length function rnd_str($len) {