- 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
<?php
session_start();
if(empty($_SESSION['UserLogin']) or empty($_SESSION['UserId']))
{
header('Location: /');
}
else
{
if($_GET['mess_id'] == "")
{
header('Location: /');
}
else
{
include("application/db.config.php");
$GetUserIdQuery = mysql_query("SELECT id FROM Users WHERE id=".$_SESSION['UserId'], $db);
$UserIdArr = mysql_fetch_array($GetUserIdQuery);
$GetMessInfoQuery = mysql_query("SELECT * FROM Messages WHERE DialogId=".$_GET['mess_id'], $db);
$MessageInfoArr = mysql_fetch_array($GetMessInfoQuery);
if($UserIdArr['id'] != $MessageInfoArr['UserTo'])
{
header('Location: /');
}
else
{
mysql_close($db);
......................................................... и так далее...
}
}
}
Lowezar 15.12.2012 01:36 # +3
bormand 15.12.2012 10:04 # +3
Отличное описание для вышеприведенного кода.
Stud 19.12.2012 11:16 # −1