STRING // Turn a path (relative to root) into absolute URL function root_url($string) { return protocol() . "://" . $_SERVER['HTTP_HOST'] . "/" . $GLOBALS['root'] . $string; } // NIL --> STRING // Return the current protocol (HTTP, HTTPS, etc) function protocol() { return explode('/', $_SERVER['SERVER_PROTOCOL'])[0]; } // STRING --> NIL // Redirect to a regular URL (I.E., "https://duckduckgo.com") function redirect($url) { header('Location: ' . $url); return; } // STRING --> NIL // Redirect to a URL relative to root (I.E., "res/img/") function root_redirect($path) { header('Location: ' . root_url($path)); return; }