1
0
mirror of https://github.com/Rouji/single_php_filehost.git synced 2025-04-05 00:49:33 +00:00

Add site_url() function

This commit is contained in:
mul91n 2021-08-15 09:32:24 +10:00
parent ecebb86614
commit 0c65194d4f

View File

@ -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)
{