<?php
/*
* @ServerMon v1.1
* @Developed by Maksa988
* @www.Server-Mon.ru
* @Copyright (C) 2014
*/
 if(!defined('SMON'))
	die('Hacking attempt!');

class Request extends Config { 
	public function GET($var= ''){
		global $db;
		if(empty($var)):
			$get = explode("/", $_GET['action']);
			if($get[0] == 'admin'){
				if(!empty($get[3])):
					return $db->real_escape_string(stripslashes(htmlspecialchars(trim($get[3]))));
				endif;
			} else {
				if(!empty($get[2])):
					return $db->real_escape_string(stripslashes(htmlspecialchars(trim($get[2]))));
				endif;
			}
		else:
			return $db->real_escape_string(stripslashes(htmlspecialchars(trim($_GET[$var]))));
		endif;
	}
	
	public function POST($var){
		global $db;
		return $db->real_escape_string(stripslashes(htmlspecialchars(trim($_POST[$var]))));
	}
	
	public function redirect($url) {
		header('Location: ' . $url);
		exit;
	}
}
?>
