Dear experts!
There is such a construction:
//Страницы сайта $page = isset($_GET['p']) ? $_GET['p'] : 'error'; switch($page){ //Home page case 'home': include($_SERVER['DOCUMENT_ROOT'].'/page/home.php'); break; //Страница услуг case 'services': include($_SERVER['DOCUMENT_ROOT'].'/page/service.php'); break; //Страница ошибок case 'error': include($_SERVER['DOCUMENT_ROOT'].'/page/error.php'); break; //Home page (default) default: include($_SERVER['DOCUMENT_ROOT'].'/page/home.php'); break; exit(); } This code is located in the index.php file in the root directory. According to the idea, when you open the index.php file, the default home.php file should be included - but for some reason it gives error.php (the error.php file opens) what is written wrong here? correct me please
mysite.ru?p=? - Alexey Shimanskypin the gett request does not exist .... respectively in the condition$page = isset($_GET['p']) ? $_GET['p'] : 'error';$page = isset($_GET['p']) ? $_GET['p'] : 'error';the variable is assigned theerrorvalue .... and then in thecaseaccording to the rule, it goes there - Alexey Shimansky