File size: 906B
<?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 "сообщения удалены!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?password=$password&name=$name\">";
}
else
{
echo "Вы не админ!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?password=$password&name=$name\">";
}
}
else
{
echo "ошибка на пароле";
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
}
else
{
echo 'ошибка на пароле или имени';
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
include("foot.php");
?>