add base_url() function in helpers, works with https and port number

This commit is contained in:
0xRenegade
2022-09-24 14:32:04 -05:00
parent cccf3ada43
commit f064d8f1ef
+9
View File
@@ -116,3 +116,12 @@ function paginationLinks($current_page, $total_pages, $base_url) {
return $html;
}
function base_url(){
return sprintf(
"%s://%s:%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME'],
$_SERVER['SERVER_PORT']
);
}