<?php
session_start();
$db = mysql_connect ("localhost","gumerov_test","2101986");
mysql_select_db("basa_m",$db);
if (isset($_POST['login']) && isset($_POST['password'])) {
$login = $_POST['login'];
$password = $_POST['password'];
$query = "SELECT password FROM users WHERE login='".$login."'";
$lst = @mysql_query($query);
if (mysql_num_rows($lst) > 0) {
$_SESSION['login'] = $login;
}
}
if (isset($_SESSION['login'])) {}
else {
if (isset ($login)) {
echo "<h2>Вход с таким логином и паролем невозможен!</h2>";
exit;
}
else {
echo "<h2>Вы не вошли в систему!</h2>";
exit;
}
};
?>
|