File size: 0.99Kb
<?
include $DOCUMENT_ROOT.'/inc/header.php';
include $DOCUMENT_ROOT.'/inc/db/config.php';
$query = "SELECT count(*) FROM admins WHERE 1 AND name = '".$login."' AND password = '".$pass."';";
//session_start();
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
$ra = mysql_fetch_array($result);
if (!$ra) echo mysql_error();
$answer = $ra ['count(*)'];
if (!$answer) echo mysql_error();
if ($answer == 1)
{
$_SESSION['id'] = session_id();
include 'link.php';
}
else echo 'Авторизация <b>не пройдена !</b><br/><a href="index.php">Нажмите для повторной попытки</a>';
include $DOCUMENT_ROOT.'/inc/footer.php';
?>