if (file_exists("all/$page.php"))
include "all/$page.php";
else if ($_SESSION['id'] and file_exists("auth/$page.php"))
include "auth/$page.php";
else if (!$_SESSION['id'] and file_exists("guest/$page.php"))
include "guest/$page.php";
else if ($_SESSION['admin'] and file_exists("admin/$page.php"))
include "admin/$page.php";
else if (is_numeric($page)) {
$_SESSION['ref'] = $page;
location('register');
}
else
exit('Страница 404');
<?php
$to = 'sales@c.kz';
$from = 'sales@c.kz';
$subject = 'Заявка';
$subject = '=?utf-8?b?'. base64_encode($subject) .'?=';
$headers = "Content-type: text/plain; charset=\"utf-8\"\r\n";
$headers .= "From: ". $from ." <". $from ."> \r\n";
mail($to, $subject, " текст " , $headers);
echo 'Отправлено'; ?>