Просмотр файла forum/reg.php

Размер файла: 4.36Kb
<?
header("Content-Type: text/vnd.wap.wml; charset=utf-8");


require "consts.php";
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);



$truba=$HTTP_USER_AGENT;





$god=$data12;
$god.="-";
$god.=$data13;
$god.="-";
$god.=$data14;








if ($truba=="WinWAP-PRO/3.1 (3.1.6.192)")
{
$reg=1;
}
elseif ($truba=="SIE-ME45/28 UP.Browser/5.0.2.3.100 (GUI)")
{
$reg=1;
}
elseif ($truba=="SIE-C55/20 UP.Browser/5.0.2.3.100 (GUI)")
{
$reg=1;
}
elseif ($data1=="")
{
$reg=7;
}
elseif ($data2=="")
{
$reg=7;
}
elseif ($data3=="")
{
$reg=7;
}
elseif ($data4=="")
{
$reg=7;
}
elseif ($data7=="")
{
$reg=7;
}
elseif (($data10=="") || ($data10==" "))
{
$reg=7;

}
elseif (($data12>28) and ($data13=="feb"))
{
$reg=8;
}
elseif (($data14>2050) or ($data14<1960))
{
$reg=9;
}
else 
{



$message=$data4;

$message=encode($message);

$data4=$message;

$message=$data1;
   $message=eregi_replace("'","!", $message);
   $message=eregi_replace("<","!", $message);
   $message=eregi_replace(">","!", $message);
   $message=eregi_replace("~","!", $message);

   $message=htmlspecialchars($message);
   $message=str_replace("$", "backs", $message);

$message=encode($message);


$data1=$message;



$message=$data2;

$trans = get_html_translation_table(HTML_ENTITIES );
$message=strtr($message, $trans);
$data2=$message;



$message=$data3;

$message=encode($message);

$data3=$message;

$message=$data5;

$message=encode($message);

$data5=$message;
 $message=$data6;



$message=encode($message);
$data6=$message;


$message=$data10;


$message=ereg_replace("\/","!", $message);
$message=stripslashes($message);
   $message=eregi_replace("~","!", $message);
$message=encode($message);

$data10=$message;





$sql="select id from users where name = '$data1'";
$result=mysql_query($sql);
$row=mysql_fetch_object($result);

   if ($row->id=="")
  {
     
    $sql2="select id from users where nick = '$data10'";
$result2=mysql_query($sql2);
$row2=mysql_fetch_object($result2);
if ($row2->id=="")
  {

$dpoint=".";
$time=date(d);
$time .=$dpoint;
$time .=date(m);
$time .=$dpoint;
$time .=date(y);
If ($reg!=7)
{
$sql="insert into users (id, name, nick, pass, datereg, about, imya, status, otkuda, work, age, email, icq, telnum, god) values (null, '$data1', '$data10', '$data2', '$time', '$data3', '$data4', 'User', '$data5', '$data6', '$data7', '$data8', '$data9', '$data11', '$god')";
mysql_query($sql);
}
$sql="select id, name from users where name='$data1'";
$res=mysql_query($sql);
$row2=mysql_fetch_object($res);
$temp=$row2->name;
$temp21=$row2->id;
$sql="select nick from users where nick='$data10'";
$res=mysql_query($sql);
$row2=mysql_fetch_object($res);
$temp2=$row2->nick;
If ($temp=="")
     {

   $reg=2;

        }
elseif ($data10=="")
{


   $reg=2;

}
elseif ($temp2=="")
{


   $reg=2;

}
else
{
$user=$data1;
$reg=1;
$UINmd5=$temp21;
$pass=$data2;






}

}
else 
{
$reg=5;
}
}
else
{
  $reg=0;
}
}
echo '<?xml version="1.0" encoding="utf-8"?>';
 echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">';
 echo '<wml>';
 ?><card id="reg" ontimer="index.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>" title="&#x0420;&#x0435;&#x0433;&#x0438;&#x0441;&#x0442;&#x0440;&#x0430;&#x0446;&#x0438;&#x044F;"><?echo '<timer value="50"/>';
 echo '<p align="center">';
if ($reg==0)
{
echo '<small>Login already registered!</small>';
}
elseif ($reg==1)
  {
echo '<small>User $user has been register!</small>';
 }
 elseif($reg==2)
 {
  echo '<small>Wrong nickname! Nickname include russian chars!</small>';
 }
 elseif($reg==3)
 {
  echo 'Fuck You';
 }
 elseif($reg==5)
 {
  echo '<small>Nickname already registered!</small>';
 }
 elseif($reg==7)
 {
  echo '<small>&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;! &#x041D;&#x0435; &#x0432;&#x0441;&#x0435; &#x043E;&#x0431;&#x044F;&#x0437;&#x0430;&#x0442;&#x0435;&#x043B;&#x044C;&#x043D;&#x044B;&#x0435; &#x043F;&#x043E;&#x043B;&#x044F; &#x0437;&#x0430;&#x043F;&#x043E;&#x043B;&#x043D;&#x0435;&#x043D;&#x044B;! </small>';
 }
 elseif($reg==8)
 {
  echo '<small>&#x041D;&#x0435;&#x0432;&#x0435;&#x0440;&#x043D;&#x0430;&#x044F; &#x0434;&#x0430;&#x0442;&#x0430; &#x0440;&#x043E;&#x0436;&#x0434;&#x0435;&#x043D;&#x0438;&#x044F;</small>';
 }
 elseif($reg==9)
 {
  echo '<small>&#x041D;&#x0435;&#x0432;&#x0435;&#x0440;&#x043D;&#x044B;&#x0439; &#x0433;&#x043E;&#x0434; &#x0440;&#x043E;&#x0436;&#x0434;&#x0435;&#x043D;&#x0438;&#x044F;</small>';
 }
?>
</p>
</card>
</wml>