0){ unset($requestURI[0]); $requestURI = array_values($requestURI); $directory_debth--; } $requestURI = array_map('mysql_real_escape_string', $requestURI); if($requestURI[1] =='o'){ header('Content-type: application/json'); if(file_exists ("open/".$requestURI[2].".php")){ require("open/".$requestURI[2].".php"); } else { echo "File does not exist"; exit; } } else if(file_exists ("services/".$requestURI[1].".php")){ header('Content-type: application/json'); require('framework/auth.php'); $GLOBALS['userID'] = Autheticate(); require("services/".$requestURI[1].".php"); } else { require('views/home.php'); } mysql_close(); /*DOC alll DB Tables (that you want to interact with the direct api) need to contain user_id inputs are all posts with raw json body functions: add get to do create user keys