📄 class.php3
字号:
<?
/*大家好,我是豆腐
提供原码是我的一贯原则,但是希望大家能够尊重豆腐的工作
希望大家在使用的过程中随时和我联系 roboo@21cn.com
您可以随意修改代码,但是请保留我的注释(如果不保留,我也没办法)
如果您觉得这个程序对您有或多或少的帮助,豆腐希望能够得到您的鼓励
您的鼓励和支持,是我们工作的最大动力
. =======
/ \| O O |
\ / \v_'/
# _| |_
(#) ( )
#\//|* *|\\
#\/( * )/ //豆腐制作,都是精品
# =====
# (\ /)
# || ||
.#---'| |----.
#----' -----'
//哲人说:用我的心换你的心,我们便拥有两颗心
*/
?>
<?
$checkCookie="no";
include("conn.php3");
include("db.php3");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="class.css">
<title>同学录_注册会员</title>
</head>
<body>
<?
$intStep=$step;
if($intStep==1){
echo " <p><font color=red>1</font>:请输入您想要申请的用户代码(3-15位的字符串)</p>";
echo "<form action=". $PHP_SELF . "?step=2 method=post>";
echo "<input type=text name='txtID' maxlength=15 class=editface>";
echo "<br>";
echo "<br>";
echo "<input type=submit name='cmdGo' value='下一步' class=buttonface>";
echo "<input type=reset value='我不申请'class=buttonface>";
echo " </form>";
}
elseif($intStep==2) {
$strUID=$txtID;
$strSQL="select userid from Class_ClassUser where userID='" . $strUID . "'";
$conn=openconn();
$stmt=opensql($conn,$strSQL);
fecthrow($stmt);
if(getcolumn($stmt,"USERID")!=$strUID){
//可以申请
?>
<form action="<? echo $PHP_SELF ?>?step=3" method="post">
<TABLE border=1 width=70%>
<tr>
<td align=center width=33% class=keyItem>用户编号</td>
<TD width=33% class=keyItem><? echo $strUID ?><input type=hidden value="<? echo $strUID ?>" name="txtID"></td>
<td align=center width=33%></td>
</TR>
<tr>
<td align=center width=33%>用户姓名</td>
<TD width=33%><font color=red><input type=text name="txtName" maxlength=20 class=editface></font></td>
<td align=center width=33%></td>
</TR>
<tr>
<td align=center width=33%>用户密码</td>
<TD width=33%><font color=red><input type=password name="txtPass" maxlength=16 class=editface></font></td>
<td align=center width=33%></td>
</TR>
<tr>
<td align=center width=33%>验证密码</td>
<TD width=33%><font color=red><input type=password name="txtRePass" maxlength=16 class=editface></font></td>
<td align=center width=33%></td>
</TR>
<tr>
<td align=center width=33%>性别</td>
<TD width=33%>
<input type=radio name="cmdBoy" checked><img src="boy.jpg" width=20 height=20 alt="帅哥">
<input type=radio name="cmdBoy"><img src="girl.jpg" width=20 height=20 alt="美眉">
</td>
<td align=center width=33%></td>
</TR>
<tr>
<td align=center width=33%>出生日期</td>
<td width=33%>
<input type=text name="selYear" maxlength=4 size=4 class=editface>年
<input type=text name="selMonth" maxlength=2 size=2 class=editface> 月
<input type=text name="selDay" maxlength=2 size=2 class=editface>日
</td>
</tr>
<tr>
<td align=center>联系Email</td>
<td><input type=text name="txtMail" maxlength="40" class=editface></td>
</tr>
<tr>
<td align=center>最高学历</td>
<TD>
<select size=1 name="selDegree" class=selectFace>
<option value="小学">小学</option>
<option value="中学">中学</option>
<option value="高中">中学</option>
<option value="大专">大专</option>
<option value="本科" selected>本科</option>
<option value="硕士">硕士</option>
<option value="博士">博士</option>
</SELECT>
</td>
</tr>
<tr>
<td align=center>忘记密码的问题</td>
<td><input type=text maxlength=80 name="txtQuestion" class=editface></td>
</tr>
<tr>
<td align=center>问题的答案</td>
<td><input type=text maxlength=80 name="txtAnswer" class=editface></td>
</tr>
</table>
<input type=submit name="cmdSubmit" value="我填完了" class=buttonface>
<input type=reset value="我要重填" class=buttonface>
</form>
<?
}
else{
//用户名称已经存在
echo "<p>对不起,您所申请的用户名称已经存在!请选择别的用户代码</p>";
echo "<br>";
echo "<p><font color=red>1</font>:请输入您想要申请的用户代码(3-15位的字符串)</p>";
echo "<form action=". $PHP_SELF . "?step=2 method=post>";
echo "<input type=text name='txtID' maxlength=15 class=editface>";
echo "<br>";
echo "<br>";
echo "<input type=submit name='cmdGo' value='下一步' class=buttonface>";
echo "<input type=reset value='我不申请' class=buttonface>";
echo "</form>";
}
}
elseif($intStep==3){
//用户已经完成所有的登记
$strErr="";
if($txtQuestion==""){
$strErr=$strErr . "<p>" . "对不起,密码提示问题不能为空". "</p>";
}
if($txtAnswer==""){
$strErr=$strErr . "<p>" . "对不起,答案不能为空". "</p>";
}
if($txtName==""){
$strErr=$strErr . "<p>" . "对不起,姓名不能为空". "</p>";
}
if($txtPass!=$txtRePass){
$strErr=$strErr . "<p>" . "对不起,两次输入的密码不一致" . "</p>";
}
if($txtPass==""){
$strErr=$strErr . "<p>" . "对不起,密码不能为空". "</p>";
}
include("userfunc.php3");
if(check($selYear,$selMonth,$selDay)==false){
$strErr="<p>对不起,您输入的生日不是一个合法的日期</p>";
}
if($strErr!=""){
$strErr=$strErr . "<input type=submit value=返回 onclick='history.back();'>";
echo $strErr;
exit;
}
if($cmdBoy!=""){
$strFolk="0";
}
else{
$strFolk="1";
}
$strBirth=$selYear . "-" . $selMonth ."-" . $selDay;
$DateTimeStr=$TTime=date("Y-n-d"). " " . date("H:i:s");
$strSQL="Insert into " . $DataBaseOwerName . ".Class_classuser(USERID,PASS,USERNAME,FOLK,BIRTH,USEREMAIL,DEGREE,Question,Answer)values(";
$strSQL=$strSQL . "'" . $txtID . "','" . $txtPass . "','" . $txtName . "','" . $strFolk . "','" . $strBirth . "','" . $txtMail . "','" . $selDegree . "','" . $txtQuestion . "','". $txtAnswer ."')";
$conn=openconn();
$stmt=opensql($conn,$strSQL);
$strSQL="insert into " . $DataBaseOwerName . ".Class_userInfo(userid) values('" . $txtID . "')";
$stmt=opensql($conn,$strSQL);
?>
<p>恭喜,您已经成功的注册了你所申请的用户<font color=red><? echo $txtID;?></font></p>
<p>您现在就可以<a href="login.htm">登录</a></p>
<?
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -