Good day.
The problem is as follows:
It is necessary to obtain from the users table the value of the group field, and if the value is 1, then load the menu template for the user, and if the value is 2, then load the menu template for the admin. Either incorrectly form a request, or there is some kind of catch.
Code about the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php session_start(); include ("bd.php"); $result = mysql_query("SELECT group FROM users"); $user_group = mysql_fetch_row($result); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Заказ комплексных обедов с доставкой</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <?php require 'tpl/sablon.php'; if ($user_group = 1) { require 'bloks/menu.php'; } if ($user_group = 2) { require 'bloks/menu2.php'; } ?> <div id="content"> <h1>Вход на сайт</h1> <form action="testreg.php" method="POST"> <p> <label>Ваш логин<br></label> <input name="login" type="text" size="15" maxlength="15"> </p> <p> <label>Ваш пароль<br></label> <input name="password" type="text" size="15" maxlength="15"> </p> <p> <input type="submit" name="submit" value="Войти"> <a href="reg.php">Зарегистрироваться</a> </p> </form> <br> <?php if (empty($_SESSION['login']) or empty($_SESSION['id'])) { echo "Вы вошли на сайт, как гость<br><a href='#'>Эта ссылка доступна только зарегистрированным пользователям</a>"; } else { echo "Вы вошли на сайт, как ".$_SESSION['login']."(<a href='exit.php'>выход</a>)<br>"; } ?> </div> </body> </html>