Website refactoring

Moved PHP files to "lib" folder
Moved Javascript files to "lib" folder
Moved login page inline CSS to "login.css"
Moved database functions to class "Database"
Removed the html template, compensated with a direct HTML code inside PHP "else" statement
This commit is contained in:
Bryan Pedini committed 2019-03-25 11:27:37 +01:00
1 parent 5a75d5335e
commit 18dc9b18d3
12 files changed
+38 -54

No files matched your search

+29 -3
View File
@@ -18,12 +18,38 @@
$row = $result->fetch_assoc ( );
if ( ! $row ) {
http_response_code ( 404 );
include ( 'errors/404.html' );
include ( $config [ 'installation_path' ] . '/lib/errors/404.html' );
exit;
}
else {
include ( 'templates/redirect.html' );
echo ( '<script>var my_location = "' . $row [ 'URL' ] . '";</script>' );
?>
<!DOCTYPE html>
<html>
<head>
<title id="title">Redirect in 5 seconds</title>
<link href="<?=substr($_SERVER['SCRIPT_NAME'],0,-10)?>/favicon.ico" rel="icon" type="image/x-icon">
</head>
<body>
<center>
<h1>You will be redirected to <?=$row['URL']?> in <span id="body-timeout">5</span></h1>
</center>
<script>
window.onload = function() {
var seconds = 5;
function update_timeout (interval) {
document.getElementById("title").innerHTML = "Redirect in "+seconds+" seconds";
document.getElementById("body-timeout").innerHTML = seconds;
if (seconds == 0) {
window.location.href = "<?=$row['URL']?>";
clearInterval (interval);
}
}
interval = setInterval (function() {update_timeout(interval); seconds = seconds - 1;}, 1000);
}
</script>
</body>
</html>
<?php
}
}
else {