Просмотр файла lem/komments/add.php

Размер файла: 6.91Kb
<?
///////////////////////////////////////////////////////////////////////////////////////////
/////        
/////                            Made by   :  VANTUZ
/////                              E-mail  :  [email protected]        
/////                            WEB-site  :  http://www.pizdec.ru
/////                            WAP-site  :  http://wap.pizdec.ru
/////                             Skripts  :  http://wap.pizdec.ru/skripts
/////        
//////////////////////////////////////////////////////////////////////////////////////////////
	error_reporting (ERROR | WARNING);
function myErrorHandler ($errno, $errstr, $errfile, $errline) {}
set_error_handler("myErrorHandler");	


$login = htmlspecialchars(stripslashes($login));
$mail = htmlspecialchars(stripslashes($mail));
$mess = htmlspecialchars(stripslashes($mess));
$obr = htmlspecialchars(stripslashes($obr));
$login = strip_tags($login);
$login = trim($login);
  $mess=str_replace("$","",$mess);
 $login=str_replace("quot;","",$login);
            $login=str_replace("$","",$login);
            $login=str_replace("&lt;","",$login);
            $login=str_replace("<","",$login);
            $login=str_replace(">","",$login);
            $login=str_replace("&gt;","",$login);
            $login=str_replace("\"","",$login);
            $login=str_replace("'","",$login);
            $login=str_replace("\\","",$login);
            $login=str_replace("&","",$login);
             $login=str_replace("%","",$login);
              $login=str_replace(" ","",$login);
              
            $login=str_replace("@","",$login);
            $login=str_replace("^","",$login);
            $login=str_replace("*","",$login);
            $login=str_replace(")","",$login);
            $login=str_replace("(","",$login);
            $login=str_replace("|","",$login);
            $login=str_replace("!","",$login);
            $login=str_replace("№","",$login);
            $login=str_replace(";","",$login);
            $login=str_replace("/","",$login);
            $login=str_replace("{","",$login);
            $login=str_replace("}","",$login);
            $login=str_replace("[","",$login);
            $login=str_replace("]","",$login);

if ($login == "") {  header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card title=\"WAP.PIZDEC.RU\" ontimer=\"obr.php?nom=$nom\"><timer value=\"20\" />
<p>ВЫ не написали свое имя !
<br/><br/>
<a href=\"obr.php?nom=$nom\">Еще раз!</a>
</p>
</card>
</wml>"; exit;}


if ($login == '"') {  header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card title=\"ILI.WAB.RU\" ontimer=\"obr.php?nom=$nom\"><timer value=\"20\" />
<p>ВЫ не написали свое имя !
<br/><br/>
<a href=\"obr.php?nom=$nom\">Еще раз!</a>
</p>
</card>
</wml>"; exit;}

if ($mess == "") {  header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card title=\"ILI.WAB.RU\" ontimer=\"obr.php?nom=$nom\"><timer value=\"20\" />
<p>ВЫ не написали комментарий !
<br/><br/>
<a href=\"obr.php?nom=$nom\">Еще раз!</a>
</p>
</card>
</wml>"; exit;} 










if ($tr==5) {
        
$trans1= array("E","F","CH","SH","IU","IA","A","B","V","G","D","ZH","Z","I","K","L","M","N","O","R","S","T","U","H","C","Y","ch","sh","iu","ia","a","b","v","g","d","e","zh","z","i","k","l","m","n","o","p","r","s","t","u","f","h","c","'","y","J","j","P"    
                );
        
        
$trans2= array("&#x0415;","&#x0424;","&#x0427;","&#x0428;","&#x042E;","&#x042F;","&#x0410;","&#x0411;","&#x0412;","&#x0413;","&#x0414;","&#x0416;","&#x0417;","&#x0418;","&#x041A;","&#x041B;","M","&#x041D;","&#x041E;","&#x0420;","&#x0421;","&#x0422;","&#x0423;","&#x0425;","&#x0426;","&#x042B;","&#x0447;","&#x0448;","&#x044E;","&#x044F;","&#x0430;","&#x0431;","&#x0432;","&#x0433;","&#x0434;","&#x0435;","&#x0436;","&#x0437;","&#x0438;","&#x043A;","&#x043B;","&#x043C;","&#x043D;","&#x043E;","&#x043F;","&#x0440;","&#x0441;","&#x0442;","&#x0443;","&#x0444;","&#x0445;","&#x0446;","&#x044C;","&#x044B;","&#x0419;","&#x0439;","&#x041F;"
                );

$mess=str_replace($trans1,$trans2,$mess);               
        };









$currHour=date("H",time());
        $currDate=date("d.F.Y", time());
        $currTime=date("$currHour:i", time());

$currDate = str_replace("January","01",$currDate);
$currDate = str_replace("February","02",$currDate);
$currDate = str_replace("March","03",$currDate);
$currDate = str_replace("April","04",$currDate);
$currDate = str_replace("May","05",$currDate);
$currDate = str_replace("June","06",$currDate);
$currDate = str_replace("July","07",$currDate);
$currDate = str_replace("August","08",$currDate);
$currDate = str_replace("September","09",$currDate);
$currDate = str_replace("October","10",$currDate);
$currDate = str_replace("November","11",$currDate);
$currDate = str_replace("December","12",$currDate);

$currDate = str_replace("2006","06",$currDate);
$currDate = str_replace("2007","07",$currDate);
$currDate = str_replace("2008","08",$currDate);
$currDate = str_replace("2009","09",$currDate);
$currDate = str_replace("2010","10",$currDate);

$yv=$obr;
$obr=$login;
$af = @implode("",@file("af/$nom.txt"));   
if ($yv!="") {$yv="$yv, ";};
$text = "$currDate | $currTime<br/>
<b>$login</b><br/>
$yv $mess<br/><br/>";

$mess= trim($mess);
$af = trim($af);



if ($mess == $af) {  header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card title=\"WAP.PIZDEC.RU\" ontimer=\"obr.php?nom=$nom\"><timer value=\"20\" />
<p>Такой комментарий уже есть !
<br/><br/>
<a href=\"obr.php?nom=$nom\">Еще раз!</a>
</p>
</card>
</wml>"; exit;} 





  

 {



$counter_array = file("cont/$nom.dat");
$id = $counter_array[0]+1;
$fp = @fopen("cont/$nom.dat","wb");
@fputs($fp,$id);
@fclose($fp);



$fp=mkdir("rek/$nom",0770);


$fp=fopen("rek/$nom/$id.txt","w");                                                                  
fputs($fp,"$text \r\n");
fclose($fp);  
chmod ("rek/$nom/$id.txt", 0777);                                                                               

$fp=fopen("af/$nom.txt","w");
fputs($fp,"$mess \r\n");
fclose($fp); 


$delfile = $id - 30;
   if ($id>31)    { unlink ("rek/$nom/$delfile.txt"); };  



 };

    

  header ("Content-type: text/vnd.wap.wml");
  header ("Location: index.php?nom=$nom&f=$f ");
?>