View file book/add.php

File size: 8.44Kb
<?
///////////////////////////////////////////////////////////////////////////////////////////
/////        
/////                        Made by   :  АХХХУЕННЫЙ ЧУВАК VANTUZ
/////                          E-mail  :  [email protected]        
/////                        WEB-site  :  http://www.pizdec.ru
/////                        WAP-site  :  http://wap.pizdec.ru
/////                          
//////////////////////////////////////////////////////////////////////////////////////////////
include "config.php";
$u1=getenv('HTTP_USER_AGENT');
$brayz=strtok($u1,'/');
$u2=getenv('HTTP_USER_AGENT');
$hostex = gethostbyaddr($REMOTE_ADDR);
$ip=getenv("REMOTE_ADDR");  
$from=getenv("HTTP_REFERER"); 

$currHour=date("H",time());///////////   
$currDate=date("d.F", time());
$curr=date("i:s", time());
$currTime=date("$currHour:i", time());
$vrem=time();
if($log!=$admin){$log="";}
if($pas!=$parad) {$log="";}
$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);




header("Content-type:text/html; charset=utf-8");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<meta http-equiv=\"refresh\" content=\"1;URL=index.php?log=$log&amp;pas=$pas\"/>	
<title>$zag</title></head><body bgcolor=\"#000000\"><p align=\"center\">";
                                                   
if($log!=""){$imja=$log;}
if($imja=="") {$ntext="";}
if(!preg_match("/^([a-z,0-9])+\@([a-z,0-9])+(\.([a-z,0-9])+)+$/", $email))
{ $email=""; }       
$vsego = file("vsego.shet");
$vsego=$vsego[0];
if($vsego>0){$i=$vsego-3;} else{$i=0;}            
while($i <= $vsego)
        {$tex=@file("zapis/$i.mess");
        $utex=explode(":||:",$tex[0]);
        $text=trim($utex[2]);
        if($ntext==$text){$ntext="";}
        $i=$i+1;}

if($ntext!=""){
$imja = substr($HTTP_POST_VARS["imja"],0,15);
$ntext = substr($HTTP_POST_VARS["ntext"],0,400);
$ntext=str_replace("\"","",$ntext);
$imja=str_replace("\"","",$imja);
$ntext=str_replace("\\","",$ntext);
$imja=str_replace("\\","",$imja);
$ntext=str_replace("|","",$ntext);
$imja=str_replace("|","",$imja);
$from=str_replace("&amp;","",$from);
        $ntext=htmlspecialchars(stripslashes($ntext));
        $imja=htmlspecialchars(stripslashes($imja));
            $brayz=htmlspecialchars(stripslashes($brayz));
              $u2=htmlspecialchars(stripslashes($u2));
               $hostex=htmlspecialchars(stripslashes($hostex));
        $ip=htmlspecialchars(stripslashes($ip));
         $email=htmlspecialchars(stripslashes($email));
            $from=htmlspecialchars(stripslashes($from));
             
$ntext=str_replace("$","у.е.",$ntext);
$imja=str_replace("$","",$imja);
$ntext=str_replace("$ ","",$ntext);
$imja=str_replace("$ ","",$imja);
$ntext=str_replace("=","",$ntext);
$imja=str_replace("=","",$imja);


                        $conv1 = array(":)",":(",":E",":smok1",":smok2",":smok3",":monyment",":cvetok",":jazik",
                        ":grin",":fack",":plach",":viking",";)",":P",":chajnik",":pozdravlenie",":ryki",
                        ":pivo1",":best",":cool",":wc",":bye",":nika",":kiss1",":encore",":kiss2",":drun",
                        ":love",":beer",":luv",":syper",":gost",":dont",":lamer",":roza",":gitara",":mogila");

                         $conv2 =array("<img src=\"sm/s1.gif\" alt=\":)\"/>",
                        "<img src=\"sm/s2.gif\" alt=\":(\"/>",
                        "<img src=\"sm/s3.gif\" alt=\":E\"/>",
                        "<img src=\"sm/s4.gif\" alt=\"kyrit\"/>",
                        "<img src=\"sm/s5.gif\" alt=\"kyrit\"/>",
                        "<img src=\"sm/s6.gif\" alt=\"kyrit\"/>",
                        "<img src=\"sm/s7.gif\" alt=\"monyment\"/>",
                        "<img src=\"sm/s8.gif\" alt=\"cvetok\"/>",
                        "<img src=\"sm/s9.gif\" alt=\"jazik\"/>",
                        "<img src=\"sm/s10.gif\" alt=\"grin\"/>",
                        "<img src=\"sm/s11.gif\" alt=\"fack\"/>",
                        "<img src=\"sm/s12.gif\" alt=\"plach\"/>",
                        "<img src=\"sm/s13.gif\" alt=\"viking\"/>",
                        "<img src=\"sm/s14.gif\" alt=\";)\"/>",
                        "<img src=\"sm/s15.gif\" alt=\":P\"/>",
                        "<img src=\"sm/s16.gif\" alt=\"chajnik\"/>",
                        "<img src=\"sm/s17.gif\" alt=\"pozdravlenie\"/>",
                        "<img src=\"sm/s18.gif\" alt=\"ryki\"/>",
                        "<img src=\"sm/s19.gif\" alt=\"pivo1\"/>",
                        "<img src=\"sm/s20.gif\" alt=\"best\"/>",
                        "<img src=\"sm/s21.gif\" alt=\"cool\"/>",
                        "<img src=\"sm/s22.gif\" alt=\"wc\"/>",
                        "<img src=\"sm/s23.gif\" alt=\"bye\"/>",
                        "<img src=\"sm/s24.gif\" alt=\"nika\"/>",
                        "<img src=\"sm/s25.gif\" alt=\"kiss\"/>",
                        "<img src=\"sm/s26.gif\" alt=\"encore\"/>",
                        "<img src=\"sm/s27.gif\" alt=\"kiss\"/>",
                        "<img src=\"sm/s28.gif\" alt=\"drun\"/>",
                        "<img src=\"sm/s29.gif\" alt=\"love\"/>",
                        "<img src=\"sm/s30.gif\" alt=\"beer\"/>",
                        "<img src=\"sm/s31.gif\" alt=\"love\"/>",
                        "<img src=\"sm/s32.gif\" alt=\"syper\"/>",
                        "<img src=\"sm/s33.gif\" alt=\"gost\"/>",
                        "<img src=\"sm/s34.gif\" alt=\"dont\"/>",
                        "<img src=\"sm/s35.gif\" alt=\"lamer\"/>",
                        "<img src=\"sm/s36.gif\" alt=\"roza\"/>",
                        "<img src=\"sm/s37.gif\" alt=\"gitara\"/>",
                        "<img src=\"sm/s38.gif\" alt=\"mogila\"/>");

        $ntext=str_replace($conv1,$conv2,$ntext);
        include "config2.php";
$n=1; $ofset=0;
while($n <= $substr_count ){
        $pozicn = strpos($ntext, "http://",$ofset);
        $pozick = strpos($ntext, " ",$pozicn);
        $sim=$pozick-$pozicn;
        if($sim==0) {$sim="";}
        if($sim!=""){$sim=$sim+1;}
         $zamenstr = substr($ntext, $pozicn, $sim);
        $zamenstr=trim($zamenstr);
        $ntext=str_replace($zamenstr,"<a href=\"$zamenstr\">$zamenstr</a>",$ntext);
        $ofset=$pozick+$pozick1+19;
        $n=$n+1;}


if($obr!=""){$ntext="<b>$obr,</b> $ntext";}

        $zapis="$imja:||:$currDate $currTime:||:$ntext:||:$brayz:||:$u2:||:$ip:||:$from:||:$hostex:||:$email";

                $counterarray = file("vsego.shet");
                $me = $counterarray[0]+1;
                $fp = @fopen("vsego.shet","wb");
                @fputs($fp,$me);
                @fclose($fp);

                $fp=fopen("zapis/$me.mess","w");
                fputs($fp,"$zapis");                              
                fclose($fp);
                chmod ("zapis/$me.mess", 0777);

        if($ydal!=""){$del=$me-$ydal;
                        if($del>=1){unlink ("zapis/$del.mess");}}
print"<font color=\"#33FF33\">Сообщение добавленно</font><br/><br/><a href=\"index.php?log=$log&amp;pas=$pas\"><font color=\"#FFFF33\">Продолжить</font></a>";}

else{print"<font color=\"#FF0033\">При добавлении сообщения произошла ошибка. Возможно вы не заполнили одно из полей, или пытаетесь отправить подряд несколько одинаковых сообщений</font>";}



print "
<br/><a href=\"$gl\"><font color=\"#FF33FF\">На главную</font></a><br/>
</p></body></html>";

?>