session_start();
define('IN_TG',true);
require 'include/global.php';
//require dirname(__FILE__).'/include/header.php';
require 'include/register.inc.php';
if (@$_GET['action']=='2'){
check_code($_POST['yzm'],$_SESSION['code']);
$_clean=array();
$_clean['uniqid']=check_uniqid($_POST['uniqid'], $_SESSION['uniqid']);
$_clean['active']=active_uniqid();
$_clean['username']=check_username($_POST['username'],2,40);
$_clean['password']=check_password($_POST['password'], $_POST['notpassword'],6);
$_clean['passt']=check_question($_POST['passt'], 4, 20);
$_clean['passd']=check_answer($_POST['passt'],$_POST['passd'],2,20);
$_clean['sex']=check_sex($_POST['sex']);
$_clean['email']=check_mail($_POST['email'],6,40);
$_clean['$_qq']=check_qq($_POST['qq']);
$_clean['$_url']=check_url($_POST['url'],40);
@mysql_query( "INSERT INTO project.test1(
tg_id,
tg_uniqid,
tg_active,
tg_usename,
tg_password,
tg_passt,
tg_passd,
tg_email,
tg_qq,
tg_url,
tg_sex,
tg_reg_time,
tg_last_time,
tg_last_ip
)
values(
'{$_clean['uniqid']}',
'{$_clean['active']}',
'{$_clean['username']}',
'{$_clean['password']}',
'{$_clean['passt']}',
'{$_clean['passd']}',
'{$_clean['email']}',
'{$_clean['qq']}',
'{$_clean['url']}',
'{$_clean['sex']}'
'now()',
'now()',
'{$_SERVER["REMOTE_ADDR"]}'
)")or die(mysql_error());
mysql_close();
location('恭喜你,注册成功','1.php');
}else{$_SESSION['uniqid']=$_uniqid=sha1(uniqid(rand(),true));}
?>
<!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="" />
<title>多用户留言系统--注册</title>
<?php
define('script','register');
require dirname(__FILE__).'/include/tittle.php';
?>
<script src="http://127.0.0.1/project4/face.js" type="text/javascript"></script>
<!--<script src="http://127.0.0.1/project4/js/test.js" type="text/javascript"></script>
--></head>
<body>
<?php
require dirname(__FILE__).'/include/header.php';
?>
<div id="register">
<h2>会员注册</h2>
<form method="post" action="2.php?action=2">
<input type="hidden" name="uniqid" value="<?php echo $_uniqid?>"/>
<dl>
<dt>请认真填写一下内容</dt>
<dd>用 户 名:<input type="text" name="username" class="text" />(*必填,至少两位)</dd>
<dd>密 码:<input type="password" name="password" class="text" />(*必填,至少六位)</dd>
<dd>确认密码:<input type="password" name="notpassword" class="text" />(*必填,同上)</dd>
<dd>密码提示:<input type="text" name="passt" class="text" />(*必填,至少两位)</dd>
<dd>密码回答:<input type="text" name="passd" class="text" />(*必填,至少两位)</dd>
<dd>性 别:<input type="radio" name="sex" value="男" checked="checked" />男 <input type="radio" name="sex" value="女" />女</dd>
<dd class="face"><img src="face/m01.gif" alt="头像选择" id="faceimg"></img></dd>
<dd>电子邮件:<input type="text" name="email" class="text" /></dd>
<dd> Q Q :<input type="text" name="qq" class="text" /></dd>
<dd>主页地址:<input type="text" name="url" class="text" value="http://" /></dd>
<dd>验 证 码:<input type="text" name="yzm" class="text yzm" /><img src="include/comm.inc.php" id="code" /></dd>
<dd><input type="submit" class="submit" value="注册" /></dd>
</dl>
</form>
</div>
</body>
</html>
<?php
require dirname(__FILE__).'/include/footer.php';
?>
数据库字段名
tg_id mediumint(8) UNSIGNED 否 无
tg_uniqid char(40) utf8_general_ci 否 无
tg_active char(40) utf8_general_ci 否 无