File size: 8.2Kb
<?php
include 'config.php';
include 'guestbook/mylib.php';
if (!checkagent($_SERVER['HTTP_USER_AGENT'])) { noemul(); exit; }
session_start();
$lang=$_GET['lang'];
if (ereg("^SIE-.*",$_SERVER['HTTP_USER_AGENT'])) $sie=1; else $sie=0;
if (($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
if ((trim($_COOKIE['Login'])!='')&&(trim($_COOKIE['Password'])!='')) {
$login=htmlspecialchars(trim($_COOKIE['Login']),ENT_QUOTES);
$pass=htmlspecialchars(trim($_COOKIE['Password']),ENT_QUOTES);
$res=pg_query($conn,"select id,moder from users where login='$login' and passwd='$pass';");
if (pg_numrows($res)==1) {
$moder=1;
}
}
pg_close($conn);
}
if (($moder)||(isset($_SESSION['id']))) { header("Location: /"); exit; }
header("Content-type: text/vnd.wap.wml");
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.dtd">
<wml>
<?php
if ($lang=='eng')
print "<card id=\"Reg\" title=\"Register\" newcontext=\"true\">\n";
else
print "<card id=\"Reg\" title=\"Регистрация\" newcontext=\"true\">\n";
print "<p>\n";
print "* Login:\n";
print "<input type=\"text\" name=\"login\" title=\"Login\" maxlength=\"10\"/><br/>\n";
print "* E-mail: <input type=\"text\" name=\"email\" title=\"E-mail\" emptyok=\"false\" maxlength=\"30\" format=\"*x\"/><br/>\n";
if ($lang=='eng')
print "Note: You must enter VALID e-mail, your password will be e-mailed to you!<br/>\n";
else
print "ВНИМАНИЕ! Указывайте ТОЛЬКО действительный E-MAIL! Ваш пароль будет отправлен на этот адрес!<br/>\n";
print "ICQ: <input type=\"text\" name=\"icq\" title=\"ICQ\" emptyok=\"false\" maxlength=\"10\" format=\"*N\"/><br/>\n";
if ($lang=='eng')
print "* Real name:\n";
else
print "* Полное имя:\n";
print "<input type=\"text\" name=\"name\" title=\"Name\" maxlength=\"30\"/><br/>\n";
if ($lang=='eng')
print "* Birthday:\nDay:\n";
else
print "* Дата рождения:<br/>\nЧисло:\n";
if (!$sie) {
print "<select name=\"day\">\n";
for ($i=1; $i<=31; $i++) print "<option value=\"".$i."\">".$i."</option>\n";
print "</select>\n";
} else {
print "<input type=\"text\" name=\"day\" title=\"Day\" maxlength=\"2\" format=\"2N\"/>\n";
}
if ($lang=='eng') {
print "Month:\n";
if (!$sie) {
print "<select name=\"month\">\n";
print "<option value=\"1\">Jan</option>\n";
print "<option value=\"2\">Feb</option>\n";
print "<option value=\"3\">Mar</option>\n";
print "<option value=\"4\">Apr</option>\n";
print "<option value=\"5\">May</option>\n";
print "<option value=\"6\">Jun</option>\n";
print "<option value=\"7\">Jly</option>\n";
print "<option value=\"8\">Aug</option>\n";
print "<option value=\"9\">Sep</option>\n";
print "<option value=\"10\">Oct</option>\n";
print "<option value=\"11\">Nov</option>\n";
print "<option value=\"12\">Dec</option>\n";
}
} else {
print "Месяц:\n";
if (!$sie) {
print "<select name=\"month\">\n";
print "<option value=\"1\">Янв</option>\n";
print "<option value=\"2\">Фев</option>\n";
print "<option value=\"3\">Мар</option>\n";
print "<option value=\"4\">Апр</option>\n";
print "<option value=\"5\">Май</option>\n";
print "<option value=\"6\">Июнь</option>\n";
print "<option value=\"7\">Июль</option>\n";
print "<option value=\"8\">Авг</option>\n";
print "<option value=\"9\">Сен</option>\n";
print "<option value=\"10\">Окт</option>\n";
print "<option value=\"11\">Ноя</option>\n";
print "<option value=\"12\">Дек</option>\n";
}
}
if (!$sie) {
print "</select>\n";
} else {
print "<input type=\"text\" name=\"month\" title=\"Month\" maxlength=\"2\" format=\"2N\"/>\n";
}
if ($lang=='eng')
print "Year:\n";
else
print "Год:\n";
print "<input type=\"text\" name=\"year\" title=\"Year\" maxlength=\"4\" format=\"4N\"/><br/>\n";
if ($lang=='eng')
print "* Operator:\n";
else
print "* Оператор сотовой связи:\n";
print "<input type=\"text\" name=\"operator\" title=\"Operator\" maxlength=\"20\"/><br/>\n";
if ($lang=='eng')
print "Web site:\n";
else
print "Страничка в Internet:\n";
print "<input type=\"text\" name=\"website\" title=\"Website\" maxlength=\"50\"/><br/>\n";
if ($lang=='eng')
print "Wap site:\n";
else
print "Страничка в Wap:\n";
print "<input type=\"text\" name=\"wap\" title=\"Wap\" maxlength=\"50\"/><br/>\n";
if ($lang=='eng')
print "* Where are you from:\n";
else
print "* Откуда Вы:\n";
print "<input type=\"text\" name=\"fr\" title=\"From\" maxlength=\"50\"/><br/>\n";
if ($lang=='eng')
print "Phone Number:\n";
else
print "Номер телефона:\n";
print "<input type=\"text\" name=\"phonenum\" title=\"PhoneNum\" maxlength=\"25\" format=\"*N\"/><br/>\n";
if ($lang=='eng')
print "* Phone Model:\n";
else
print "* Модель телефона:\n";
print "<input type=\"text\" name=\"phonemodel\" title=\"PhoneModel\" maxlength=\"20\"/><br/>\n";
if ($lang=='eng')
print "Job:\n";
else
print "Место работы/учебы:\n";
print "<input type=\"text\" name=\"job\" title=\"Job\" maxlength=\"50\"/><br/>\n";
if ($lang=='eng')
print "More info:\n";
else
print "Дополнительно о себе:\n";
print "<input type=\"text\" name=\"info\" title=\"Info\" maxlength=\"300\"/><br/>\n";
if ($lang=='eng')
print "NOTE: Required fields marked *<br/>";
else
print "Обязательные поля отмечены *<br/>";
?>
<anchor title="Ok">Ok<go href="user_new.php" method="post">
<postfield name="login" value="$(login)"/>
<postfield name="email" value="$(email)"/>
<postfield name="icq" value="$(icq)"/>
<postfield name="name" value="$(name)"/>
<postfield name="day" value="$(day)"/>
<postfield name="month" value="$(month)"/>
<postfield name="year" value="$(year)"/>
<postfield name="operator" value="$(operator)"/>
<postfield name="fr" value="$(fr)"/>
<postfield name="website" value="$(website)"/>
<postfield name="wap" value="$(wap)"/>
<postfield name="phonenum" value="$(phonenum)"/>
<postfield name="phonemodel" value="$(phonemodel)"/>
<postfield name="info" value="$(info)"/>
<postfield name="job" value="$(job)"/>
<?php print "<postfield name=\"lang\" value=\"".$lang."\"/>\n"; ?>
</go></anchor>
</p>
</card>
</wml>