0
0

Added licensing, redirected null /go requests to homepage, corrected 404 errors.

This commit is contained in:
Bryan Pedini
2019-02-08 10:14:22 +01:00
parent 7acb2ca533
commit 168f4ece75
3 changed files with 54 additions and 1 deletions

View File

@@ -23,13 +23,18 @@
$result = $statement->get_result ( );
$row = $result->fetch_assoc ( );
if ( ! $row ) {
http_response_code ( 404 );
include ( 'errors/404.html' );
exit;
}
else {
include ( 'templates/redirect.html' );
echo ( '<script>var my_location = "' . $row [ 'URL' ] . '";</script>' );
}
}
else {
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) );
}
break;
case "login":
if ( isset ( $_SESSION [ 'user_id' ] ) ) {
@@ -113,7 +118,7 @@
break;
default:
http_response_code ( 404 );
echo "fuck, 404!";
include ( 'errors/404.html' );
die ( );
}
}