File size: 917B
<?php
include("head.php");
if(empty($name))
{
$name="";
}
if(file_exists("users/$name.dat"))
{
$myFile = "users/$name.dat";
$myPass = implode('', file($myFile));
if($myPass == "$password")
{
if ($name == "$admin")
{
$inputString = "";
$fp = fopen( "messages.dat" , "w" );
fwrite($fp, $inputString);
fclose($fp);
echo "Сообщения удалены!<br>";
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?password=$password&name=$name\">";
}
else
{
echo "Вы не админ!<br>";
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?password=$password&name=$name\">";
}
}
else
{
echo "Неверный пароль<br>";
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
}
else
{
echo 'Неверное имя или пароль<br>';
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
include("foot.php");
?>