<?php	/* простейший движок CMS */
	class Engine 
{ 
	private $_page_file = null;
	private $_error = null;
	public function __construct() 
	{
		if (isset($_GET["id"]))
			{
				$this->_page_file = $_GET["id"];
				$this->_page_file = str_replace(".", null, $_GET["id"]);
				$this->_page_file = str_replace("/", null, $_GET["id"]);
				$this->_page_file = str_replace("\\", null, $_GET["id"]);
		
				if (!file_exists("html/" . $this->_page_file . ".html"))
				{
					$this->_setError("Страница не существует");
					$this->_page_file = "no";
				}
			}
		else $this->_page_file = "no";
	}
	private function _setError($error) 
		{
			$this->_error = $error;
		}
	public function getError() 
		{
			return $this->_error;
		}
	public function getContentpage()
	{
		return file_get_contents("html/" . $this->_page_file . ".html");
	}
}
?>