Просмотр файла public_html/znak/red.php

Размер файла: 12.01Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php"; 

$text = @file("../local/profil/$log.prof"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);
$privat=trim($udata[10]);}

switch($action) {
default:

if($themes!=="WML"){	
echo"<form method=\"post\" action=\"red.php?action=edit\">";

print "<small>&#x412;&#x432;&#x435;&#x434;&#x438;&#x442;&#x435; &#x441;&#x432;&#x43E;&#x439; ID:</small><br>";
print "<input type=\"text\" name=\"id\" format=\"*N\" maxlength=\"20\"/><br>";
print "<small>&#x412;&#x432;&#x435;&#x434;&#x438;&#x442;&#x435; &#x441;&#x432;&#x43E;&#x439; &#x43F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;:</small><br>";
print "<input type=\"text\" name=\"password\" maxlength=\"20\"/><br>";
print "<input value=\"OK\" name=\"do\" type=\"submit\"></form>"; 
}else{


print "<small>&#x412;&#x432;&#x435;&#x434;&#x438;&#x442;&#x435; &#x441;&#x432;&#x43E;&#x439; ID:</small><br>";
print "<input type=\"text\" name=\"id\"  format=\"*N\" maxlength=\"20\"/><br>";
print "<small>&#x412;&#x432;&#x435;&#x434;&#x438;&#x442;&#x435; &#x441;&#x432;&#x43E;&#x439; &#x43F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;:</small><br>";
print "<input type=\"text\" name=\"password\" maxlength=\"20\"/><br>";
echo"<anchor>OK
<go href=\"red.php?action=edit\" method=\"post\">
<postfield name=\"id\" value=\"$(id)\"/>
<postfield name=\"password\" value=\"$(password)\"/>
</go>
</anchor><br>";}


break;


case 'edit':
$user_info = join('', file("base/$id.txt"));

list($login, $mail, $name, $age, $rost, $hair, $eye, $city, $hobbi, $pov, $info, $date, $pas) = explode(":::",$user_info);

if($password==$pas){

if($themes!=="WML"){	
echo"<form method=\"post\" action=\"red.php?action=save\">";

print "<b>*&#1053;&#1080;&#1082;:</b><br>";
print "<input type=\"text\" name=\"login\" value=\"$login\" maxlength=\"20\"/><br>";
print "<b>*&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;</b>:<br>";
print "<input type=\"text\" name=\"pas\" value=\"$pas\" maxlength=\"20\"/><br>";
print "<b>E-mail:</b><br>";
print "<input type=\"text\" name=\"mail\" value=\"$mail\" maxlength=\"40\"/><br>";
print "<b>*&#x418;&#x43C;&#x44F;:</b><br>";
print "<input type=\"text\" name=\"name\" value=\"$name\" maxlength=\"30\"/><br>";
print "<b>*&#x412;&#x43E;&#x437;&#x440;&#x430;&#x441;&#x442;:</b><br>";
print "<input type=\"text\" name=\"age\"  format=\"*N\" value=\"$age\" maxlength=\"2\"/><br>";
print "<b>&#x420;&#x43E;&#x441;&#x442;:</b><br>";
print "<input type=\"text\" name=\"rost\"  format=\"*N\" value=\"$rost\" maxlength=\"4\"/><br>";
print "<b>&#x417;&#x43D;&#x430;&#x43A; &#1079;&#1086;&#1076;&#1080;&#1072;&#1082;&#1072;:</b><br>";
print "<input type=\"text\" name=\"hair\" value=\"$hair\" maxlength=\"40\"/><br>";
print "<b>&#x426;&#x432;&#x435;&#x442; &#x413;&#x43B;&#x430;&#x437;:</b><br>";
print "<input type=\"text\" name=\"eye\" value=\"$eye\" maxlength=\"40\"/><br>";
print "<b>*&#x413;&#x43E;&#x440;&#x43E;&#x434;</b><br>";
print "<input type=\"text\" name=\"city\" value=\"$city\" maxlength=\"35\"/><br>";
print "<b>*&#1059;&#1074;&#1083;&#1077;&#1095;&#1077;&#1085;&#1080;&#1103;:</b><br>";
print "<input type=\"text\" name=\"hobbi\" value=\"$hobbi\" maxlength=\"90\"/><br>";
print "<b>*&#x426;&#x435;&#x43B;&#x44C; &#x437;&#x43D;&#x430;&#x43A;&#x43E;&#x43C;&#x441;&#x442;&#x432;&#x430;:</b><br>";
print "<input type=\"text\" name=\"pov\" value=\"$pov\" maxlength=\"120\"/><br>";
print "<b>*&#x41E; &#x441;&#x435;&#x431;&#x435;:</b><br>";
print "<input type=\"text\" name=\"info\" value=\"$info\" maxlength=\"150\"/><br>";
print "<input type=\"hidden\" name=\"id\" value=\"$id\" maxlength=\"150\"/>";
print "<input value=\"OK\" name=\"do\" type=\"submit\"></form>"; }else{


print "<b>*&#1053;&#1080;&#1082;:</b><br>";
print "<input type=\"text\" name=\"login$rand\" value=\"$login\" maxlength=\"20\"/><br>";
print "<b>*&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;</b>:<br>";
print "<input type=\"text\" name=\"pas$rand\" value=\"$pas\" maxlength=\"20\"/><br>";
print "<b>E-mail:</b><br>";
print "<input type=\"text\" name=\"mail$rand\" value=\"$mail\" maxlength=\"40\"/><br>";
print "<b>*&#x418;&#x43C;&#x44F;:</b><br>";
print "<input type=\"text\" name=\"name$rand\" value=\"$name\" maxlength=\"30\"/><br>";
print "<b>*&#x412;&#x43E;&#x437;&#x440;&#x430;&#x441;&#x442;:</b><br>";
print "<input type=\"text\" name=\"age$rand\"  format=\"*N\" value=\"$age\" maxlength=\"2\"/><br>";
print "<b>&#x420;&#x43E;&#x441;&#x442;:</b><br>";
print "<input type=\"text\" name=\"rost$rand\"  format=\"*N\" value=\"$rost\" maxlength=\"4\"/><br>";
print "<b>&#x417;&#x43D;&#x430;&#x43A; &#1079;&#1086;&#1076;&#1080;&#1072;&#1082;&#1072;:</b><br>";
print "<input type=\"text\" name=\"hair$rand\" value=\"$hair\" maxlength=\"40\"/><br>";
print "<b>&#x426;&#x432;&#x435;&#x442; &#x413;&#x43B;&#x430;&#x437;:</b><br>";
print "<input type=\"text\" name=\"eye$rand\" value=\"$eye\" maxlength=\"40\"/><br>";
print "<b>*&#x413;&#x43E;&#x440;&#x43E;&#x434;</b><br>";
print "<input type=\"text\" name=\"city$rand\" value=\"$city\" maxlength=\"35\"/><br>";
print "<b>*&#1059;&#1074;&#1083;&#1077;&#1095;&#1077;&#1085;&#1080;&#1103;:</b><br>";
print "<input type=\"text\" name=\"hobbi$rand\" value=\"$hobbi\" maxlength=\"90\"/><br>";
print "<b>*&#x426;&#x435;&#x43B;&#x44C; &#x437;&#x43D;&#x430;&#x43A;&#x43E;&#x43C;&#x441;&#x442;&#x432;&#x430;:</b><br>";
print "<input type=\"text\" name=\"pov$rand\" value=\"$pov\" maxlength=\"120\"/><br>";
print "<b>*&#x41E; &#x441;&#x435;&#x431;&#x435;:</b><br>";
print "<input type=\"text\" name=\"info$rand\" value=\"$info\" maxlength=\"150\"/><br>";

echo"<anchor>OK
<go href=\"red.php?action=save\" method=\"post\">
<postfield name=\"login\" value=\"$(login$rand)\"/>
<postfield name=\"pas\" value=\"$(pas$rand)\"/>
<postfield name=\"mail\" value=\"$(mail$rand)\"/>
<postfield name=\"sex\" value=\"$(sex$rand)\"/>
<postfield name=\"name\" value=\"$(name$rand)\"/>
<postfield name=\"age\" value=\"$(age$rand)\"/>
<postfield name=\"rost\" value=\"$(rost$rand)\"/>
<postfield name=\"hair\" value=\"$(hair$rand)\"/>
<postfield name=\"eye\" value=\"$(eye$rand)\"/>
<postfield name=\"city\" value=\"$(city$rand)\"/>
<postfield name=\"hobbi\" value=\"$(hobbi$rand)\"/>
<postfield name=\"pov\" value=\"$(pov$rand)\"/>
<postfield name=\"info\" value=\"$(info$rand)\"/>
<postfield name=\"date\" value=\"$date\"/>
<postfield name=\"id\" value=\"$id\"/>
</go>
</anchor><br>";}


}else{echo"&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!";}

break;

case 'save':

$password=$_POST['password'];
$pas=$_POST['pas'];

if($password !== $pas){
$login = strip_tags($login);
$pas = strip_tags($pas);
$mail = strip_tags($mail);
$sex = strip_tags($sex);
$name = strip_tags($name);
$age = strip_tags($age);
$rost = strip_tags($rost);
$hair = strip_tags($hair);
$eye = strip_tags($eye);
$city = strip_tags($city);
$hobbi = strip_tags($hobbi);
$pov = strip_tags($pov);
$info = strip_tags($info);


$mail = trim($mail);


if (!$pas){print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x412;&#x432;&#x435;&#x434;&#x438;&#x442;&#x435; &#x43F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$login){print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$age)  {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$name) {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$city) {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$hobbi) {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$pov) {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}
if (!$info) {print "<b>&#x41E;&#x428;&#x418;&#x411;&#x41A;&#x410;</b><br>&#x417;&#x430;&#x43F;&#x43E;&#x43B;&#x43D;&#x438;&#x442;&#x435; &#x432;&#x441;&#x435; &#x43E;&#x431;&#x44F;&#x437;&#x430;&#x442;&#x435;&#x43B;&#x44C;&#x43D;&#x44B;&#x435; &#x43F;&#x43E;&#x43B;&#x44F;!<br><a href=\"new.php\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a><br> <a href=\"index.php\">&#x41C;&#x435;&#x43D;&#x44E;</a><br> <a href=\"$index\">&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x430;&#x44F;</a> </p></card></wml>"; exit;}

$date = date("d-m-Y");

$zap = "$login:::$mail:::$name:::$age:::$rost:::$hair:::$eye:::$city:::$hobbi:::$pov:::$info:::$date:::$pas:::"; //&#x444;&#x43E;&#x440;&#x43C;&#x430;&#x442; &#x437;&#x430;&#x43F;&#x438;&#x441;&#x438; &#x432; $sex.txt
$fileinfo = fopen("base/$id.txt","w"); /////// &#x43E;&#x442;&#x43A;&#x440;&#x44B;&#x432;&#x430;&#x435;&#x43C; base/$login.txt &#x43D;&#x430; &#x437;&#x430;&#x43F;&#x438;&#x441;&#x44C;
fputs($fileinfo,"$zap \r\n");      //// &#x437;&#x430;&#x43F;&#x438;&#x441;&#x44B;&#x432;&#x430;&#x435;&#x43C; &#x434;&#x430;&#x43D;&#x43D;&#x44B;&#x435; &#x432; &#x441;&#x442;&#x440;&#x43E;&#x43A;&#x443;
fclose($fileinfo);                 //// &#x437;&#x430;&#x43A;&#x440;&#x44B;&#x432;&#x430;&#x435;&#x43C; &#x444;&#x430;&#x439;&#x43B;
echo "&#x423;&#x441;&#x43F;&#x435;&#x448;&#x43D;&#x43E; &#x441;&#x43E;&#x445;&#x440;&#x430;&#x43D;&#x435;&#x43D;&#x43E;!"; }else{
echo "&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!!!";}
break;

}



include_once"../themes/$config_themes/foot.php";
?>