File size: 2.84Kb
<?
error_reporting(0);
include "config.php";
include "header.php";
if(!$act)
{
$viewmess = file("data/$name.$antihak.txt");
$viewmess = explode("|", $viewmess[0]);
$pass_user = $viewmess[1];
$user_pol = $viewmess[2];
$name_user = $viewmess[3];
$dr = $viewmess[4];
$city = $viewmess[5];
$photo = $viewmess[6];
$site = $viewmess[7];
$mail = $viewmess[8];
$infa = $viewmess[9];
$time_reg = $viewmess[10];
$status = $viewmess[11];
echo "$name, это редактор вашей анкеты.<br/>
<form action=\"edit_user.php\" method=\"post\">
<input type=\"hidden\" name=\"act\" value=\"edit\" >
<input type=\"hidden\" name=\"name\" value=\"$name\" >
Настоящее имя<br/>
<input type=\"text\" name=\"name_user\" maxlength=\"450\" value=\"$name_user\"/>
<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=\"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/>";
echo "<a href=\"index.php?name=$name&pass=$pass\">Назад</a><br/>";
}
if ($act=="edit")
{
if (empty($pass_user))
{
$error = $error."unknown_password";
}
$viewmess = file("data/$name.$antihak.txt");
$viewmess = explode("|", $viewmess[0]);
$nick = $viewmess[0];
$pass = $viewmess[1];
$status = $viewmess[11];
if ($pass_user==$pass)
{
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);
$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_reg|$status|"."\r\n"."$back");
flock ($file,LOCK_UN);
fclose($file);
header ("Location: index.php?name=$nick&pass=$pass_user&infa=edit_user");
}
else
{
header ("Location: index.php?name=$nick&pass=$pass_user&infa=$error");
}
}
else
{
echo "Ошибка авторизации";
}
}
echo "$bottom";
?>