- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
<?
include "../db.php";
if (isset($_POST['auth_name'])) {
$name=mysql_real_escape_string($_POST['auth_name']);
$pass=mysql_real_escape_string($_POST['auth_pass']);
$query = "SELECT * FROM skygall_opt WHERE name='$name' AND pass='$pass'";
$res = mysql_query($query) or trigger_error(mysql_error().$query);
if ($row = mysql_fetch_assoc($res)) {
session_start();
$_SESSION['user_id'] = $row['id'];
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
}
header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
echo "<center><div class=alert>Введенный логин/пароль неверны.</div></center>";
exit;
}
if (isset($_REQUEST[session_name()])) session_start();
if (isset($_SESSION['user_id']) AND $_SESSION['ip'] == $_SERVER['REMOTE_ADDR']) return;
else {
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>SkyGallery Ver 1.0 — Администрирование</title>
<link href="../st.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../scripts/form.js"></script>
<?
include "../verh.php";
?>
<br><br><br><br><form id="form1" name="form1" method="POST" action="">
<table width="350" align="center" border="0" cellspacing="5">
<tr>
<td rowspan="3" valign="top"><img src="pic/Login.png"></td>
<td>Логин:</td>
<td><input class=bginp2 onblur=inputBG(this,0) onfocus=inputBG(this,1) type="text" name="auth_name"></td>
</tr>
<tr>
<td>Пароль:</td>
<td><input class=bginp2 onblur=inputBG(this,0) onfocus=inputBG(this,1) type="password" name="auth_pass"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value=" войти "></td>
</tr>
</table>
</form>
<br><br><br><br>
<?
include "../niz.php";
}
exit;
?>
Vasiliy 19.03.2014 15:49 # 0
Elvenfighter 20.03.2014 04:07 # +5
guest 21.03.2014 10:07 # +2
vadik 25.08.2021 21:15 # 0