<?php
header('content-type:text/html;charset=UTF-8');
include ('config.php');
$ad_name=$_POST['ad_name'];
$ad_word=$_POST['ad_word'];
$ad_pass=$_POST['ad_pass'];
mysql_connect("$dbhost","$dbusername","$dbuserpwd") or die($TEXT['connErr']);
mysql_select_db("$dbname") or die("error");
mysql_query("SET NAMES 'utf8'");
$query = "select ad_name from bbb_user where ad_name = '$ad_name'"; /*仿°æ®åºä¸å¯»æ¾ç¸åååçç¨æ·*/
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
if($numrows != 0){
$temp = $TEXT['nameWarn'];
}
else if ($ad_name == ""){
$temp = $TEXT['insertName'];
}
else if ($ad_word == ""){
$temp = $TEXT['insertPass'];
}
else if ($ad_word != $ad_pass){
$temp = $TEXT['passWarn'];
}
else if (!ereg_replace("([^0-9a-zA-Z])","",$ad_name)){
$temp = $TEXT['nameVal'];
}
else
{
$query="insert into bbb_user values(0,'$ad_name',md5('$ad_pass'))"; /*æ¾ä¸å°ç¸åçå°±è¾å
¥æ°çç¨æ·èµæ*/
$result=mysql_query($query);
$temp = $TEXT['regSuc'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo $TEXT['reg'];?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/login.css" rel="stylesheet" type="text/css" title="Default" />
</head>
<body>
<div id="regbox">
<div id="logo"><img alt="" src="img/logo.png" height="40" width="250" title="openology.org" /></div>
<div id="loginbody">
<form method="post" action="register.php">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="230"> </td>
<td width="210" class="p11" valign="bottom"><font color="#FF6699">*</font><?php echo $TEXT['must'];?></td>
</tr>
<tr>
<td width="25%" id="logincontent"><?php echo $TEXT['username'];?>:</td>
<td><input type="text" name="ad_name" size="20" class="c3a"><font color="#FF6699">*</font></td>
</tr>
<tr>
<td width="25%" id="logincontent"><?php echo $TEXT['password'];?>:</td>
<td><input type="password" name="ad_word" size="20" class="c3a"><font color="#FF6699">*</font></td>
</tr>
<tr>
<td width="25%" id="logincontent"><?php echo $TEXT['confpass'];?>:</td>
<td><input type="password" name="ad_pass" size="20" class="c3a"><font color="#FF6699">*</font></td>
</tr>
<tr>
<td colspan="2"><div align="right"><input type="submit" name="Submit" value="<?php echo $TEXT['confirm'];?>"> <input type="reset" name="Submit2" value="<?php echo $TEXT['reset'];?>"></div></td>
</tr>
<tr>
<td align="left"><font style="font-size:12;color:#ffffff;"><?php echo $temp;?></font></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>