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

Размер файла: 3.14Kb
<?
error_reporting(0); 
include "config.php";
include "header.php";
 if(!$act)        
{
echo "Регистрация администратора<br/>
<form action=\"admin.php\" method=\"post\">
<input type=\"hidden\" name=\"act\" value=\"send\"/>
Введите ник (латинскими буквами)
<br/>
<input type=\"text\" name=\"nick\" maxlength=\"450\" value=\"$nick\"/>
<br/>
Пароль (буквы A-Z,a-z,0-9)<br/>
<input type=\"text\" name=\"pass_user\" maxlength=\"450\" value=\"$pass_user\"/>
<br/>
Имя (будет использоватся при добавлении ответа)<br/>
<input type=\"text\" name=\"name_user\" maxlength=\"450\" value=\"$name_user\"/>
<br/>Половая принадлежность
<br/>
<select name=\"user_pol\">
<option value=\"Парень\">Парень
</option>
<option value=\"Девушка\">Девушка
</option>
</select><br/>
День, месяц, год рождения<br/>
<input type=\"text\" name=\"dr\" maxlength=\"450\" value=\"$dr\"/>
<br/>
Место жительства<br/>
<input type=\"text\" name=\"city\" maxlength=\"450\" value=\"$city\"/>
<br/>
Фото (как адрес в интернете)<br/>
<input type=\"text\" name=\"photo\" maxlength=\"450\" value=\"$photo\"/>
<br/>
Сайт<br/>
<input type=\"text\" name=\"site\" maxlength=\"450\" value=\"$site\"/>
<br/>
Контактная информация<br/>
<input type=\"text\" name=\"mail\" maxlength=\"450\" value=\"$mail\"/>
<br/>
О себе<br/>
<input type=\"text\" name=\"infa\" maxlength=\"450\" value=\"$infa\"/>
<br/>
<input type=\"submit\" value=\"регистрировать\"/>
</form>
<br/>";
}
if ($act=="send")
{
if (empty($pass_user))
{
$error = $error."unknown_password";
}
if (empty($nick))
{
$error = $error."nick_unknown";
}
$viewmess = file("data/$nick.$antihak.txt");
$viewmess = explode("|", $viewmess[0]);
$nick_user = $viewmess[0];
if ($nick==$nick_user)
{
header ("Location: index.php?infa=off_reg");
}
else
{

if (empty($error))
{
$infa=del($infa);
$gr=del($dr);
$city=del($city);
$mail=del($mail);
$infa=bbcode($infa);
$dr=bbcode($dr);
$city=bbcode($city);
$mail=bbcode($mail);
$mail=antimat($mail);
$city=antimat($city);
$dr=antimat($dr);
$infa=antimat($infa);
$site = str_replace('http://','',$site);
$site = str_replace("$site","http://$site",$site);
$photo = str_replace('http://','',$photo);
$photo = str_replace("$photo","http://$photo",$photo);
$back2 = @file_get_contents("users.txt");
$file2 = fopen("users.txt","w");
fputs($file2,"$nick|$user_pol"."\r\n"."$back2");
flock ($file2,LOCK_UN);
fclose($file2);
$back = @file_get_contents("data/$nick.$antihak.txt");
$file = fopen("data/$nick.$antihak.txt","w");
fputs($file,"$nick|$pass_user|$user_pol|$name_user|$dr|$city|$photo|$site|$mail|$infa|$time $date|Админ|"."\r\n"."$back");
flock ($file,LOCK_UN);
fclose($file);
header ("Location: admin.php?act=del&name=$nick&pass=$pass_user");
}
else
{
header ("Location: index.php?name=$nick&pass=$pass_user&infa=$error");
}
}
}
if ($act=="del")
{
@unlink("admin.php");
header ("Location: index.php?infa=zakladka&name=$name&pass=$pass");
}
echo "<a href=\"index.php?name=$name&pass=$pass\">Назад</a><br/>
$bottom";
?>