<?php
//?????????
Error_Reporting(E_ALL & ~E_NOTICE);
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
print '<?xml version="1.0" encoding="utf-8"?>';
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
/////////////////////////////////////////////////////////////////////////////////////////////////
include "./ini.php";
//////////////////////////////////////////////////////////////////////////////////////////////////////
//???????? ???? ????????????
//???????????? ?????????? ??????
$login=htmlspecialchars(stripslashes(trim($login)));
$login=substr($login,0,10);
$pass=htmlspecialchars(stripslashes(trim($pass)));
$pass=substr($pass,0,10);
$name=htmlspecialchars(stripslashes(trim($name)));
$name=substr($name,0,30);
$live=htmlspecialchars(stripslashes(trim($live)));
$live=substr($live,0,3);
$sex=htmlspecialchars(stripslashes(trim($sex)));
$mobile=htmlspecialchars(stripslashes(trim($mobile)));
$mobile=substr($mobile,0,30);
$about=htmlspecialchars(stripslashes(trim($about)));
$about=substr($about,0,100);
$email=htmlspecialchars(stripslashes(trim($email)));
$email=substr($email,0,30);
$wapurl=htmlspecialchars(stripslashes(trim($wapurl)));
$wapurl=substr($wapurl,0,30);
$weburl=htmlspecialchars(stripslashes(trim($weburl)));
$weburl=substr($weburl,0,30);
$icq=htmlspecialchars(stripslashes(trim($icq)));
$icq=substr($icq,0,9);
$operator=htmlspecialchars(stripslashes(trim($operator)));
$operator=substr($operator,0,30);
$tel=htmlspecialchars(stripslashes(trim($tel)));
$tel=substr($tel,0,20);
$sity=htmlspecialchars(stripslashes(trim($sity)));
$sity=substr($sity,0,40);
//????? ???????? ? ???????
print '<card title="'.$lang['reg'].'">'.
'<p align="left">';
//?????? ? ???? ??????
$query_users_login = @mysql_query("select * from `".$px.$utable."` where login='".$login."';");
$users_login = @mysql_fetch_array($query_users_login);
///????????? ?????? ????, ?????????? ?????? ? ??????????
if(empty($login)) $error=$lang['login_no_entering'].'<br/>';
if(empty($pass)) $error=$error.$lang['pass_no_entering'].'<br/>';
if(empty($name)) $error=$error.$lang['name_no_entering'].'<br/>';
if(preg_match("/[^\da-zA-Z-@#!_]+/",$login)) $error.=$lang['error_login'].'<br/>';
if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.=$lang['error_pass'].'<br/>';
///////////////////////////////////
$db_login = $users_login['login'];
//???? ?????? ???
if(empty($error))
{//???? ????? ? ?????? ?????
//???? ????????? ????? ?? ????? ?????? ? ????, ??:
if(strtolower($login) != strtolower($db_login))
{
//?????? ?? ??????????? ????????????
@mysql_query("insert into `".$px.$utable."` values(0,'$login','$pass','$name','1','prohozhij',0,0,'','','','','','',0,1,0,'".time()."','".time()."','".getenv(REMOTE_ADDR)."','".getenv(HTTP_USER_AGENT)."','$lng','');");
if(!empty($login))
$q = @mysql_query("select `id` from `".$px.$utable."` where `login`='".$login."';");
if(empty($id)) {
$data = @mysql_fetch_array($q);
$id = $data['id'];
}
$login = autorize();
print $lang['thank_reg']."<br/>".$lang['reg_da']." :<br/>
".$lang['reg_id']." : <u>".$login['id']."</u><br/>
".$lang['reg_log']." : <u>".$login['login']."</u><br/>
".$lang['reg_pass']." : <u>".$login['pass']."</u><br/>
".$lang['reg_vhod']." ";
print '<anchor>'.$lang['enter'].'<go href="enter.php?id='.$id.'&pass='.$pass.'" method="post">
<postfield name="login" value="$(login)"/>
<postfield name="pass" value="$(pass)"/>
</go>
</anchor>';
}
else
{
print $lang['sorry_reg']."<br/><anchor><prev/>$lang[back]</anchor>";
}
}
else
{//??????? ??????
print $error."<br/><anchor><prev/>$lang[back]</anchor>";
}
print '</p></card></wml>';
//????????? ?????????? ? ??
@mysql_close();
?>