<?php
global $myArray;

require("global.php");

$myArray = processURI();

// Check if second arg is a script name
if (file_exists($myArray['arg2'].".php")) {
	// Its a script, so action is arg 3
	if (!empty($myArray['arg3'])) {
		$action = $myArray['arg3'];
	}
	include($myArray['arg2'].".php");
} elseif (file_exists("downloads.php")) {
	// Not a script, so action is arg 2
	$action = $myArray['arg2'];
	include("downloads.php");
} else {
	include("error.php");
}
exit();

?>