Файл: postdelmes.php
Строк: 23
<?php
include 'config.php';
include 'functions.php';
$mes=$_GET['mes'];
$mes_id=mes_gaga($mes);
if (empty($mes_id)) {
include 'head.php';
echo 'Такого сообщения не существует!<br/>'; exit($end); }
if (!empty($_SESSION['rand']))
{
$_SESSION['rand']='';
$_SESSION['text']='';
$var='0';
$file=file ('msg.dat');
$count=count($file);
for($i=0;$i<$count;$i++)
{
$ex=explode('#/#/#',$file[$i]);
if ($ex[1]==$mes)
{
$string=str_replace($file[$i],'',file_get_contents("msg.dat"));
$fopen=fopen("msg.dat","w");
fputs($fopen,$string);
fclose($fopen);
$var='1';
}
}
if (!empty($var)) {
$_SESSION['text'].='Сообщение удалено!<br/>';
} else {
$_SESSION['text'].='Сообщение не удалено!<br/>'; }
}
header("location:index.php");
?>