View file game/gamereg2.php

File size: 1.32Kb
<?php

  extract($HTTP_GET_VARS);
  extract($HTTP_POST_VARS);
  extract($HTTP_COOKIE_VARS);
  extract($HTTP_SESSION_VARS);
session_name("SID");
session_start();

	if($chis==$_SESSION['press_kod']){

require("datafunc.php");
$result=SetUser($_GET['nn'], "", $_GET['pass']);
if ($result) msg($result);
msg("<small><b>Регистрация успешно завершена!<br/>
<a href=\"1/f_connect.php?login=".$_GET['nn']."&amp;p=".$_GET['pass']."\">[в игру]</a></b></small>
"); } else {

msg("<small><b>Проверочное число не совпало!!!</b></small>");}
$press_kod='';
$press_kod=rand(1111111,9999999); 
session_register("press_kod");
session_unset();
session_destroy();

function msg($s) {
	header("Content-type:text/vnd.wap.wml;charset=utf-8");

	setlocale (LC_CTYPE, 'ru_RU.CP1251');
	function win2unicode ( $s ) { if ( (ord($s)>=192) & (ord($s)<=255) ) $hexvalue=dechex(ord($s)+848); if ($s=="Ё") $hexvalue="401"; if ($s=="ё") $hexvalue="451"; return("&#x0".$hexvalue.";");}
	function translate($s) {return(preg_replace("/[А-яЁё]/e","win2unicode('\\0')",$s));}

	ob_start("translate");
	echo "<?xml version=\"1.0\"?>\n<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
	echo "
<wml>
<card title=\"Регистрация\">
<p>";
echo "
$s
</p>
</card>
</wml>";
	ob_end_flush();
	die("");
	}