30 lines
942 B
PHP
30 lines
942 B
PHP
<?php
|
|
session_start ( );
|
|
require_once ( 'functions.php' );
|
|
$config = load_config ( );
|
|
$request = split_uri_array ( $_SERVER [ 'SCRIPT_NAME' ], $_SERVER [ 'REQUEST_URI' ] );
|
|
if ( isset ( $request [ 0 ] ) && $request [ 0 ] != "" ) {
|
|
switch ( $request [ 0 ] ) {
|
|
case "go":
|
|
include ( 'lib/php/go.php' );
|
|
break;
|
|
case "login":
|
|
include ( 'lib/php/login.php' );
|
|
break;
|
|
case "logout":
|
|
include ( 'lib/php/logout.php' );
|
|
break;
|
|
case "insert":
|
|
include ( 'lib/php/insert.php' );
|
|
break;
|
|
default:
|
|
http_response_code ( 404 );
|
|
include ( 'errors/404.html' );
|
|
die ( );
|
|
}
|
|
}
|
|
else {
|
|
header ( "Location: " . substr ( $_SERVER [ 'SCRIPT_NAME' ], 0, -10 ) . "/login" );
|
|
}
|
|
?>
|