<?
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
include_once("files/antixak.php");
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("data/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {
$fal = @file("data/reg/$log.dat");
$udata = explode(":||:",$fal[0]);
if($_POST[chat]!=="1" || $_POST[chat]!=="0"){ header ("Location: setting.php?log=$log&pas=$pas&error");}
if($_POST[pict]!=="1" || $_POST[pict]!=="0"){ header ("Location: setting.php?log=$log&pas=$pas&error");}
if(eregi("[^0-9]",$_POST[kolchat])){ header ("Location: setting.php?log=$log&pas=$pas&error"); exit;}
//////////////////////////////////
$chat=str_replace("\\","",$chat);
$chat=str_replace("/","",$chat);
$chat=str_replace("|","",$chat);
$chat=str_replace("$","",$chat);
$chat=str_replace("&","",$chat);
$chat=str_replace("<","",$chat);
$chat=str_replace(">","",$chat);
//////////////////////////////////
$pict=str_replace("\\","",$pict);
$pict=str_replace("/","",$pict);
$pict=str_replace("|","",$pict);
$pict=str_replace("$","",$pict);
$pict=str_replace("&","",$pict);
$pict=str_replace("<","",$pict);
$pict=str_replace(">","",$pict);
//////////////////////////////////
$kolchat=str_replace("\\","",$kolchat);
$kolchat=str_replace("/","",$kolchat);
$kolchat=str_replace("|","",$kolchat);
$kolchat=str_replace("$","",$kolchat);
$kolchat=str_replace("&","",$kolchat);
$kolchat=str_replace("<","",$kolchat);
$kolchat=str_replace(">","",$kolchat);
//////////////////////////////////
$text=$udata[0].':||:'.$udata[1].':||:'.$udata[2].':||:'.$udata[3].':||:'.$udata[4].':||:'.$udata[5].':||:'.$udata[6].':||:'.$udata[7].':||:'.$udata[8].':||:'.$udata[9].':||:'.$udata[10].':||:'.$udata[11].':||:'.$udata[12].':||:'.$udata[13].':||:'.$udata[14].':||:'.$udata[15].':||:'.$udata[16].':||:'.$udata[17].':||:'.$udata[18].':||:'.$udata[19].':||:'.$udata[20].':||:'.$chat.':||:'.$udata[22].':||:'.$udata[23].':||:'.$udata[24].':||:'.$udata[25].':||:'.$udata[26].':||:'.$udata[27].':||:'.$udata[28].':||:'.$udata[29].':||:'.$udata[30].':||:'.$udata[31].':||:'.$udata[32].':||:'.$udata[33].':||:'.$pict.':||:'.$kolchat.':||:'.$udata[36].':||:'.$udata[37].':||:'.$udata[38].':||:'.$udata[39].':||:'.$udata[40].':||:';
$fp=fopen("data/reg/$log.dat","a+");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
header ("Location: setting.php?save&log=$log&pas=$pas"); }else{echo"<small>Пароль или логин неверен!</small>";}
include_once"files/down.php";
?>