0
0
This repository has been archived on 2020-11-15. You can view files and clone it, but cannot push or open issues or pull requests.
OpenShorte.old/index.php
Bryan 81d21c311f
Minor changes
Moved config into $GLOBALS
Moved request_uri into $GLOBALS
Modified all files accordingly
Modified logout page for future improvements (not deleting the entire $_SESSION)
Fixed LICENSEs, moved LICENSE for PHP files in /lib/php subfolder instead of /lib
2019-04-06 11:57:35 +02:00

29 lines
916 B
PHP

<?php
session_start ( );
require_once ( 'functions.php' );
$GLOBALS [ 'config' ] = load_config ( );
$GLOBALS [ 'request_uri' ] = split_uri_array ( );
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" );
}