<?php

require_once('functions.php');

echo $_SERVER['QUERY_STRING'];

// Split query string and perform actions based on it with conditional includes

?>

<?php

/* Include Function Library */
require_once('functions.php');


/* Session Authentication
 *
 * Session data is protected by a mutex lock while writable. Free the lock
 * by committing as soon as possible so that concurrent requests complete
 * quickly. */
session_start();
if (empty($_SESSION['userId'])) {
	//require('login.php');
}
session_commit();


/* Query Resolution
 *
 * Split the query string on the slash character to create an array of
 * arguments. Then conditionally include script files to handle requests
 * based on those arguments. */
$query = trim($_SERVER['QUERY_STRING'], '/');
$argv  = explode('/', $query); // $arg will always contain at least one element
$argc  = count($argv);

if ($argv[0] == 'assignment') {
	//require('assignment.php');
} else if ($argv[0] == 'course') {
	//require('course.php');
} else if ($argv[0] == 'report') {
	//require('report.php');
} else if ($argv[0] == 'serve') {
	//require('serve.php');
} else {
	//require('course.php');
}

?>

Add initial structure to authenticate and parse arguments
Add initial structure to authenticate and parse arguments
