File size: 915B
<?php
include 'include/head.php';
if(empty($name) or empty($pass))
{
echo 'Write name and password!';
echo '<meta http-equiv="refresh" content="2; url=login.php">';
exit;
}
if(file_exists("users/$name.class"))
{
$myFile = "users/$name.class";
$myPass = implode('', file($myFile));
if($myPass == "$pass")
{
if(file_exists("letters/$name.class"))
{
unlink('letters/'.$name.'.class');
echo 'Letters deleted!';
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?name=$name&pass=$pass\">";
}
else
{
echo 'Letters is not exist!';
echo "<meta http-equiv=\"refresh\" content=\"2; url=index.php?name=$name&pass=$pass\">";
}
}
else
{
echo 'Error in password!';
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
}
else
{
echo 'This user is not exist!';
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
include 'include/foot.php';
?>