PHP Code:
<?php
$file="include/func.inc.php";
if (file_exists($file)){include_once($file);}else{include_once("../".$file);}sitetest();
function DeCode($string,$operation,$key='')
{
$key=md5($key);
$key_length=strlen($key);
$string=$operation=='D'?base64_decode($string):substr(md5($string.$key),0,8).$string;
$string_length=strlen($string);
$rndkey=$box=array();
$result='';
for($i=0;$i<=255;$i++)
{
$rndkey[$i]=ord($key[$i%$key_length]);
$box[$i]=$i;
}
for($j=$i=0;$i<256;$i++)
{
$j=($j+$box[$i]+$rndkey[$i])%256;
$tmp=$box[$i];
$box[$i]=$box[$j];
$box[$j]=$tmp;
}
for($a=$j=$i=0;$i<$string_length;$i++)
{
$a=($a+1)%256;
$j=($j+$box[$a])%256;
$tmp=$box[$a];
$box[$a]=$box[$j];
$box[$j]=$tmp;
$result.=chr(ord($string[$i])^($box[($box[$a]+$box[$j])%256]));
}
if($operation=='D')
{
if(substr($result,0,8)==substr(md5(substr($result,8).$key),0,8))
{
return substr($result,8);
}
else
{
return'';
}
}
else
{
return str_replace('=','',base64_encode($result));
}
}
$UserID=$_POST["UserID"];
$Password=$_POST["Password"];
$Email=$_POST["Email"];
$UserName=$_POST["UserName"];
$Sex=$_POST["Sex"];
$IDCard=$_POST["IDCard"];
$mt2regCode=$_POST["mt2regCode"];
$Ques=$_POST["Ques"];
$Ques=DeCode($_POST["Ques"],'E','daichao');
$Answ=DeCode($_POST["Answ"],'E','daichao');
$BirthYear=$_POST["BirthYear"];
$BirthMonth=$_POST["BirthMonth"];
$BirthDay=$_POST["BirthDay"];
$Addr=$_POST["Addr"];
$PostCode=$_POST["PostCode"];
$Mobile=$_POST["Mobile"];
$Telephone=$_POST["Telephone"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Info-Tipps</title>
<style type="text/css">
<!--
body,td,th {
color: #F00;
}
body {
background-color: #000;
}
-->
</style></head>
<body bgcolor="#CCCCCC">
<?php
if (strlen($UserID) < 4) {$error=$error."<br>User-Name kann nicht leer sein! Und nicht weniger als 6 Zeichen";}
if (strlen($Password) < 4) {$error=$error."<br>Passwort darf nicht weniger als 8 Zeichen";}
if (strlen($Email) < 1) {$error=$error."<br>Email Erforderlich";}
if (strlen($UserName) < 1) {$error=$error."<br>Realer Name muß ausgefüllt werden";}
if (strlen($IDCard) != 7) {$error=$error."<br>Charater_löschunsgode muß 7 stellig sein";}
if (strlen($Answ) < 1) {$error=$error."<br>Frage und Antworten muß ausgefüllt werden";}
if (strlen($error) > 0){
echo "Registrierung fehlgeschlagen,<a href=\"javascript:history.back();\">Zurück</a>$error";exit;
}else{
mysql_select_db("account");
$exec="select * from account where Login='$UserID'";
$result=mysql_query($exec);
$rs=mysql_fetch_object($result);
if($rs){
echo"Der Benutzer ist bereits vorhanden,<a href=\"javascript:history.back();\">Zurück</a>";
exit;
}else{
$exec="insert into account (Login,Password,Real_name,Social_id,Email,Phone1,Phone2,Address,Question1,Answer1) values('$UserID',password('$Password'),'$UserName','$IDCard','$Email','$Mobile','$Telephone','$Addr','$Ques','$Answ')";
mysql_query("set names big5 ");
mysql_query("set CHARACTER big5 ");
mysql_query($exec);
//echo mysql_error();
//echo $exec;
//$exec="insert into player.safebox(account_id,size,password) values((select id from account.account where login='$UserID') ,1,'000')";
//mysql_query($exec);
//echo mysql_error();
//echo "<br>".$exec;
?>
<center>
<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td colspan="2" align="center"><span class="content style2"><h3>Registrierung Erfolgreich<br />Ihre Registrierungs-Daten<br />viel Spaß beim Sielen!</h3>
</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="36%" align="center">Benutzername:</td>
<td width="64%"><?php echo $UserID?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Passwort:</td>
<td><?php echo $Password?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">E-Mail:</td>
<td ><?php echo $Email?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Realer Name:</td>
<td ><?php echo $UserName?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Charater-Löschung:</td>
<td ><?php echo $IDCard?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Passwort Anfrage:</td>
<td ><?=DeCode($Ques,'D','daichao');?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Antwort:</td>
<td ><?=DeCode($Answ,'D','daichao');?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">Geburtstag:</td>
<td ><?php echo $BirthYear."-".$BirthMonth."-".$BirthDay?></td>
</tr>
</table>
<a href="index.php"><img src="Bilder/bt_confirm.gif" width="82" height="30" border="0" /></a>
</center>
<?php
}
}
?>
</body>
</html>