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

Размер файла: 4.08Kb
<?php
include "config.php";
echo "<HTML>";
echo "<HEAD>";
echo "<TITLE>";
echo "$clan\n";
echo "Clan - Administration</TITLE>";
echo "<link rel=\"stylesheet\" href=\"$css\">";
echo "<meta HTTP-EQUIV=\"Content-Type\" Content=\"text-html; charset=Windows-1251\">";
echo "</head><BODY bgcolor=\"$bgcolor\" text=\"#cccccc\">";
echo "<table border=\"0\" width=100%>\n";
echo "<td width=\"16%\"><img src=\"$logo_image\"></td>\n";
echo "<td><h1>$clan Clan</h1></td></tr>\n";
echo "<tr><td  valign=top width=\"16%\" valign=top><form action=\"login.php\" method=post><hr>\n";
echo "ID: <input type=\"text\" name=\"id\" maxlength=\"5\" size=10><br>\n";
echo "<input type=\"image\" src=\"000.jpg\" value=\"вход\" hight=1 align=\"right\"></form><hr>\n";
echo "<a href=\"index.php\">Главная</a><br>\n";
echo "<a href=\"registr.php?go=reg\">Регистрация</a><br>\n";
echo "<a href=\"index.php?remind=1\">Забыл ID?</a><br>\n";
echo "<a href=\"members.php\" target=_blank>Участники</a><br>\n";
echo "<a href=\"mailto:$admin_mail\">Письмо админу</a> <br><br><hr>";
echo "<table cellpadding=2 cellspacing=1 bgcolor=#cccccc>\n";
echo "<tr><td border=0 bgcolor=#454545><center>Члены клана</center></td></tr>\n";
echo "<tr><td bgcolor=#838383>\n";
$file = "members.dat";
$open = fopen ($file, "r");
$login = file($file);
$count2 = count($login);
if ($count2>0){
for ($n=0; $n<$count2; $n++) {
list( $fid,$fmail,$fcity,$fcountry,$fname,$flastname,$fnick,$fage,$ficq,$fgame, $fstaus, $fdate ) = split("\|", "$login[$n]");
echo "$fstaus $fnick<br>";}
fclose($open);}else {
echo "<center>никого</center>\n";}
echo"</td></tr></table></td><td valign=top>";
include("rules.php");
if ($remind=="1") {
echo "<center>\n";
echo "<table cellpadding=2 cellspacing=1 bgcolor=#cccccc width=\"250\">\n";
echo "<tr><td border=0 bgcolor=#454545>";
echo "<center>\n";
echo "Восстановление забытого ID\n";
echo "</center>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "<table cellpadding=2 cellspacing=1 bgcolor=#cccccc width=\"250\">\n";
echo "<tr>\n";
echo "<td bgcolor=#838383 width=\"100\">\n";
echo "<form action=\"index.php\" method=\"post\">\n";
echo "Ваш Ник:</td><td bgcolor=#838383 width=\"150\"><input type=text name=\"name\" maxlength=\"10\" size=20></td></tr><tr>\n";
echo "<td bgcolor=#838383 width=\"100\">\n";
echo "Ваш E-Mail:</td><td width=\"150\" bgcolor=#838383><input type=text maxlength=\"20\" name=\"mail\" size=20></td></tr>\n";
echo "</table><table cellpadding=2 cellspacing=1 bgcolor=#cccccc width=\"250\">\n";
echo "<tr><td bgcolor=#454545><center>\n";
echo "<input type=submit name=\"ok\" value=\"Восстановить\"></center></td></tr></table>\n";
echo "</form>\n";
echo "</center>\n";}

if ($ok=="Восстановить"){
if (empty($name)) {echo "Необходимо ввести ник<br>";exit;}
if (empty($mail)) {echo "Необходимо ввести e-mail";exit;}
$pattern = ".+@.+\..+";
if (eregi($pattern, $mail)){
$filo = "members.dat";
$openk = fopen ($filo, "r");
$data1 = file($filo);
$count1 = count($data1);
for ($n=0; $n<$count2; $n++) {
list( $fid,$fmail,$fcity,$fcountry,$fname,$flastname,$fnick,$fage,$ficq,$fgame ) = split("\|", "$data1[$n]");
if ($name==$fnick && $mail==$fmail) {
$mail_file = "mail.dat";
$target = fopen($mail_file,"r");
$data2 = file($mail_file);
$total=count($data2);
if ($total > "0" )  {
for ($n=0; $n<$total; $n++) {
list( $uname,$mail ) = split("\|", "$data2[$n]");
if ($name != $uname){
$allok = "ok\n";}
else {
$error_non_seen = "error\n";}}}
else {
$file = "mail.dat";
$yopen = fopen($file,"a");
fwrite($yopen, "$name|$mail\n");
fclose($yopen);
echo "Ваша заявка добавлена";
exit;}
fclose ($target);
if (isset($error_non_seen)) {echo "Ваша заявка ещё не рассмотрена. Ждите.";exit;}
if (isset($allok)) {
$file = "mail.dat";
$yopen = fopen($file,"a");
fwrite($yopen, "$name|$mail\n");
fclose($yopen);
echo "Ваша заявка добавлена";
exit;}
exit;}
else {
$fatal_error = "error\n";}}
fclose ($openk);}
else {
echo "Введите правильный e-mail адрес\n";}}
if (isset($fatal_error)) {echo "Человек с такими данными в базе не зарегистрирован :(";}
echo "</td></tr></table>\n";
echo "<table>\n";
?>