Просмотр файла index.php

Размер файла: 1.79Kb
<?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")
{

if(file_exists("ReadMi.txt"))
{
  echo "<a href=\"ReadMi.txt\"/>Советы</a> (Удалите файл ReadMi.txt после прочтения)<br>";
}
}

$myMess = "messages.dat";
$messages = implode('', file($myMess));
echo "<br>[ <a href=\"login.php\"/>Выход</a> | <a href=\"images.php\">Смайлы</a>]<br/><br/>";

$dat = date('H:i:s');

echo "<form action='2.php?name=$name&password=$password' method='post'>
($name - $dat):<br/><input type='text' style='background-color: #D3E5F0;' maxlength='100' name='message'><br/>
<input type='submit' value='Ск@зать'></form>";
if (empty($messages))
{
echo "$admin<br>Пустовато тут(((<br><br>";
}
else
{
function myhtml($myhtml) {
$myhtml = str_replace('.1.',' <img src="images/1.gif"> ',$myhtml);
$myhtml = str_replace('.2.',' <img src="images/2.gif"> ',$myhtml);
$myhtml = str_replace('.3.',' <img src="images/3.gif"> ',$myhtml);
$myhtml = str_replace('.4.',' <img src="images/4.gif"> ',$myhtml);
$myhtml = str_replace('.5.',' <img src="images/5.gif"> ',$myhtml);
return $myhtml; }
ob_start('myhtml');
}
echo "$messages";
if($name=="$admin")
{
echo "<br>→ <a href=\"admin.php?password=$password&name=$name\">Очистка постов</a> ←<br><br>";
}
}
else
{
echo "Неверный пароль<br><br>";
echo '<meta http-equiv="refresh" content="2; url=login.php">';
}
}
else
{
echo 'Неверное имя или пароль<br><br>';
echo '<meta http-equiv="refresh" content="2; url=login.php">';   
}
  echo '<b>'.$copy.'<b><br>';
include("foot.php");
?>