'active') ); break; case "/key/" : if($vars['REQUEST_METHOD'] == "POST") { if(!empty($_POST['user']) && !empty($_POST['password'])) { $user = $_POST['user']; $password = md5($_POST['password'].AUTH_KEY); $response = array('user'=>$user,'md5'=>$password); header('HTTP/1.1 200 OK'); echo json_encode( (object) $response ); } else { header('HTTP/1.1 403 Forbidden'); echo json_encode( (object) array('error'=>'PLease provide a valid user and matching password') ); } } else { header('HTTP/1.1 405 Method Not Allowed'); echo json_encode( (object) array('error'=>'/key/ requires POST method') ); } break; default : // header('HTTP/1.1 404 Not Found'); header('HTTP/1.1 501 Not Implemented'); echo json_encode( (object) array('error'=>'This path has not been implemented') ); break; }