<?php
session_start();
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past $Abonament = (int) $_SESSION['ID'];
$username = (isset($_POST['User'])) ? mysql_real_escape_string($_POST['User']) : '';
$password = (isset($_POST['Pass'])) ? mysql_real_escape_string($_POST['Pass']) : '';
$msg = '';
if ($username!='' && $password!='') {
$qry = "select u.ID, u.usrFullName from users u where usrLogin='".$username."' and usrPassword='".$password."'";
$p = mysql_query($qry);
if ($p) {
$r = mysql_fetch_array($p);
$_SESSION['UserID'] = $pass[0];
header('Location: <tvoiata glavna stranica>');
} else {
$msg = 'Невярна парола';
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Login</title>
<link rel="stylesheet" href="css/idocs.css" type="text/css" />
</head>
<body>
<form method="post">
<? if ($msg!='') echo("<div style='color: red; font-weight: bold;'>$msg</div>"); ?>
<table style="border: none;" cellpadding="3" cellspacing="3" border="0">
<tr>
<td style="width: 100px;" align="right">потребител:</td>
<td style="width: 200px;"><input name="User" id="User" type="text"/></td>
</tr>
<tr><td class="normaltext" align="right">парола:</td><td><input name="Pass" id="Pass" type="password"/></td></tr>
<tr>
<td colspan="2">
<table width="100%"><tr>
<td></td>
<td align="right"><input type="submit" value="вход" style="width: 80px;"/></td>
</tr></table>
</td>
</table>
</form>
</body>
</html>