<!--#include file=conn.asp-->
<!--#include file="function.asp"-->
<!--#include file="config.asp"-->
<!--#include file="md5.asp"-->
<HTML>
<HEAD>
<TITLE>用户注册</TITLE>
<META http-equiv=content-type content="text/html; charset=GB2312">
<style type="text/css">
<!--
.zhtable {table-layout:fixed; word-wrap:break-word; width:100%; }
input{font-family:"arial"}
td		{font-size: 9pt; line-height: 18px;font-family: "Arial";}
.p3		{font-size:13px; line-height: 24px;font-family: "Arial";}
.bnsrh		{padding-top:2px;height:24px}
.bn100		{padding-top:2px;height:24px;width:100px}
.bnask		{color:#000000;background-color:#FFD801;padding-top:2px;height:24px}
.bgbdy		{background-color: #FFFFFF;margin:0px;}
.bglne		{background-color: #DDF1D8; padding-right: 10px;}
.bgtle		{border-top: #58CB64 1px solid; background-color: #DDF1D8; padding-left: 10px; padding-right: 10px; height:24px; font-weight:bold; font-size: 14px;}
.bgtleBl	{border-top: #64B7D7 1px solid; background-color: #DEEEF4; padding-left: 10px; padding-right: 10px; height:24px; font-weight:bold; font-size: 14px;}
.bgtleYl	{border-top: #F4BF20 1px solid; background-color: #FBF5C6; padding-left: 10px; padding-right: 10px; height:24px; font-weight:bold; font-size: 14px;}
.bgtleR		{border-top: #58CB64 1px solid; background-color: #DDF1D8; padding-left: 10px; padding-right: 10px; height:24px;}
.bgtleL		{border-top: #58CB64 1px solid; background-color: #DDF1D8; padding-left: 10px; padding-right: 10px; height:24px; font-size: 14px; font-weight:bold;}
.bgdsrh		{background-color: #DDF1D8; padding-left: 10px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px;}
.bgdsrhLn	{background-color: #58CB64;}
.bgcnt		{background-color: #FFFFFF; padding-left: 10px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px;}
.bgcntBor3	{BORDER-left: #DDF1D8 2px solid; BORDER-right: #DDF1D8 2px solid; BORDER-bottom: #DDF1D8 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgcntBor3Bl	{BORDER-left: #DEEEF4 2px solid; BORDER-right: #DEEEF4 2px solid; BORDER-bottom: #DEEEF4 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgcntBor3Yl	{BORDER-left: #FBF5C6 2px solid; BORDER-right: #FBF5C6 2px solid; BORDER-bottom: #FBF5C6 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgcntBor4	{BORDER: #DDF1D8 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgcntBor4Bl	{BORDER: #DEEEF4 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgcntBor4YL	{BORDER: #FBF5C6 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
.bgpagLn	{BORDER: #B4DAF8 1px solid; background-color: #F9FDFF; font-size: 14px;}
.bgtab		{BORDER-TOP: #D6D6EB 1px solid; BORDER-left: #D6D6EB 1px solid; BORDER-right: #D6D6EB 1px solid; BORDER-bottom: #FFFFFF 1px solid;}
.bgtabCr	{BORDER-top: #58CB64 1px solid; BORDER-left: #58CB64 1px solid; BORDER-right: #58CB64 1px solid; BORDER-bottom: #DDF1D8 1px solid; background-color: #DDF1D8; font-weight:bold; font-size: 14px; color:#000000;}
.bgusr		{background-color: #E6F9EC;}
.lngn		{border-bottom:1px solid #6fa02b; }
.ln23		{height:23px; border-bottom:1px solid #E1E1E1;}
.ln28		{padding:3px; border-top:1px solid #E1E1E1; padding-left:6px;}
.ln20		{border-top:1px solid #E1E1E1;}
.ln28pl4	{padding:3px; border-top:1px solid #E1E1E1; padding-left:4px;}
.padL4		{padding-left:4px}
.padL6		{padding-left:6px}
.pad10L		{padding-left:10px}
.f14		{font-size: 14px;line-height: 22px;}
.f14B		{font-size: 14px; font-weight:bold;}
.f14weB		{ font-size: 14px; font-weight:bold;}
.f14ln20	{font-size: 14px; line-height: 20px;}
.lh22		{line-height: 22px;}
.f12gy		{color:#666666;}
.f12we		{color:;}
.f12og		{color:#FF6600;}
.f12gn		{color:#008800;}
.f12rd		{color:#FF3300;}
.f12b		{font-weight:bold;}
a:link			{text-decoration: underline;Color:#0000cc;}
a:visited		{text-decoration: underline;Color:;}
a.lbk:link		{color:#000000; text-decoration: underline}
a.lbk:visited		{color: #000000; text-decoration: underline}
a.lwe:link		{color:#FFFFFF; text-decoration: underline}
a.lwe:visited		{color: #FFFFFF; text-decoration: underline}
a.lmore:link		{font-weight:bold; text-decoration: underline}
a.lmore:visited		{font-weight:bold; text-decoration: underline}
a.lklbe:link		{color: #7777cc; text-decoration: underline}
a.lklbe:visited		{color: #7777cc; text-decoration: underline}
a.lkgn:link			{color: #008800; text-decoration: underline;}
a.lkgn:visited		{color: #008800; text-decoration: underline;}
a.cy:link		{color: #7777cc; text-decoration: underline}
a.cy:visited		{color: #7777cc; text-decoration: underline}
a.headTit:link{color:#0000cc;font-size:13px; line-height: 24px;}
a.headTit:visited{color:#0000cc;font-size:13px; line-height: 24px;}
.headTitB{font-weight:bold;font-size:13px; line-height: 24px;font-family: "Arial";}
.TopMgn6{margin-top:6px}
.cBaidu{color:#777777}
.padRig12{padding-right:12px;}
.fB{Font-weight:bold}
.pad3{padding:3px;}
.magBtm12{margin-bottom:12px;}
.padL12{padding-left:12px;}
.divC{width:770px;text-align:left;}
.pC{width:65%; font-size:80%;line-height:18px;}
.ResultTit{font-size : 125%; line-height:120%;margin-bottom:2px;}
.kwC{color:#FF3300;}
.fs{font-size:95%;color: #008800;}
-->
</style>
</HEAD>
<%if request("submit")="提  交" then
jiance=request("name")
if InStr(jiance,"or")<>0 or InStr(jiance,"'")<>0 or InStr(jiance,"`")<>0 or InStr(jiance,"=")<>0 or InStr(jiance,"-")<>0 or InStr(jiance,",")<>0 or InStr(jiance,"and")<>0 then 
Response.Write "<script language=JavaScript>{alert('用户名含有非法字符！');history.back();}</script>"
Response.End 
end if
if InStr(request("question"),"or")<>0 or InStr(request("question"),"'")<>0 or InStr(request("question"),"`")<>0 or InStr(request("question"),"=")<>0 or InStr(request("question"),"-")<>0 or InStr(request("question"),",")<>0 or InStr(request("question"),"and")<>0 then 
Response.Write "<script language=JavaScript>{alert('密码提示问题含有非法字符！');history.back();}</script>"
Response.End 
end if
if InStr(request("answer"),"or")<>0 or InStr(request("answer"),"'")<>0 or InStr(request("answer"),"`")<>0 or InStr(request("answer"),"=")<>0 or InStr(request("answer"),"-")<>0 or InStr(request("answer"),",")<>0 or InStr(request("answer"),"and")<>0 then 
Response.Write "<script language=JavaScript>{alert('密码提示问题答案含有非法字符！');history.back();}</script>"
Response.End 
end if
if request("email")<>"" then
if Instr(request("email"),"=")>0 or Instr(request("email"),"%")>0 or Instr(request("email"),chr(32))>0 or Instr(request("email"),"?")>0 or Instr(request("email"),"&")>0 or Instr(request("email"),";")>0 or Instr(request("email"),",")>0 or Instr(request("email"),"'")>0 or Instr(request("email"),",")>0 or Instr(request("email"),chr(34))>0 or Instr(request("email"),chr(9))>0 or Instr(request("email"),"")>0 or Instr(request("email"),"$")>0 then
		Response.Write ("<script>alert('友情提示!\n\n邮件地址含有非法字符!');history.back();</script>")
		Response.end
	end if
	if Instr(request("email"),"@")=0 then
		Response.Write ("<script>alert('友情提示!\n\n邮件地址格式不正确!');history.back();</script>")
		Response.end
	end if
	end if
if request("question")="" then
if request("answer")<>"" then
Response.Write "<script language=JavaScript>{alert('密码提示问题为空,不能单独填写提示答案！');history.back();}</script>"
Response.End 
end if
end if
	 if request("qq")<>"" then
      if not IsNumeric(request("qq")) then
		Response.Write ("<script>alert('友情提示!\n\nOICQ号码必须是数字!');history.back();</script>")
		Response.end
	end if
	end if
			if not IsNumeric(request("verifycode")) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码必须是数字!');history.back();</script>")
		Response.end
	end if
	if (int(session("SafeCode"))<>int(request("verifycode"))) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码输入错误!');history.back();</script>")
		Response.end
	end if
	  if request("name")="" then
	  response.write"<script>alert('用户名不能为空!');history.back();</script>"
	  elseif request("pwd")="" then 
	  response.write"<script>alert('密码不能为空!');history.back();</script>"
	  elseif request("pwd1")="" then 
	  response.write"<script>alert('确认密码不能为空!');history.back();</script>"
	  elseif request("pwd")<>request("pwd1") then 
	  response.write"<script>alert('两次密码不同!');history.back();</script>"
	  else
	  name=request("name")
	  pwd=request("pwd")
	  sex=request("sex")
	  question=request("question")
	  answer=request("answer")
	  qq=request("qq")
	  email=request("email")
	  jianjie=request("jianjie")
	  rs.open"select * from person where name='"&name&"'",conn,1,1
	  if not rs.eof then
	  response.write"<script>alert('该用户名已经存在!');history.back();</script>"
	  else
	  rs.close
	  rs.open"select * from person",conn,1,3
	  rs.addnew
	  rs("name")=name
	  rs("pwd")=md5(pwd)
	  rs("sex")=sex
	  if question<>"" then
	  rs("question")=question
	  end if
	  if answer<>"" then
	  rs("answer")=answer
	  end if
	  rs("qq")=qq
	  rs("email")=email
	  rs("jifen")=regf
	  rs("touxian")=""&ji1&" 一级"
	  rs("asknum")=0
	  rs("replynum")=0
	  rs("helpnum")=0
	  rs("time")=now
	  rs("jianjie")=jianjie
	  rs.update
	  session("person")=name
	  response.write"<script>alert('用户注册成功!');window.navigate('index.asp');</script>"
	  end if
	  rs.close
	  end if
	  end if
	  %>
<BODY  text=#000000 vLink=#0033cc aLink=#800080 link=#0033cc bgColor=#ffffff topMargin=0>
<TABLE width="650" align=center border=0 cellspacing="0" cellpadding="0">
  <TBODY>
    <TR >
      <TD vAlign=top width=150 height=66><a href="<%=weburl%>"><IMG src="img/logo-zhidao1.gif" width="137" height="46" border=0></a></TD>
      <TD vAlign=bottom><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR>
              <TD class="bgtleL">用户注册</TD>
            </TR>
            <TR>
              <TD height=20 class=f12gy></TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td colspan="2" height="50" class="f14" >&nbsp;<img src="img/tips.gif" width="16" height="16"></td>
  </tr>
</table>
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td colspan="2" class="bgtle" height="24">基本信息</td>
  </tr>
</table>
<table width="650" border="0" align="center" cellpadding="6" cellspacing="0">
  <tr>
    <td colspan="2" height="40" >在填写基本信息中，带<font color="#FF0000">*</font>号的为必填项。</td>
  </tr>
</table>
<table width="650"  border="0" align="center" cellpadding="0" cellspacing="6" bgcolor="#FFFFFF" height="260"><form action=reg.asp method=post>
  <tr> 
    <td width="266" class="pad10L" valign="top" height="38"> 用户名：</td>
    <td width="672" valign="top" height="38"> <input name="name" type="text" id="name" size="20"> 
      &nbsp;<font color="#FF0000">*</font><br> <font color="#666666">不超过7个汉字,或14个字符(数字，字母和下划线) </font><font color="#FF0000" class=f9>&nbsp;                           
      </font></td>
  </tr>
  <tr> 
    <td class="pad10L" valign="top" height="38"> 密 码：</td>                          
    <td valign="top" height="38"> <input type="password" name="pwd" id="pwd" size="20">  
      &nbsp;<font color="#FF0000">*</font><br>                          
      <font color="#666666">不超过14个字符(数字，字母和下划线) </font></td>
  </tr>
  <tr> 
    <td class="pad10L" valign="top" nowrap height="26"> 重新输入密码：</td>
    <td valign="top" height="26"> <input type="password" name="pwd1" id="pwd1" size="20"> 
      &nbsp;<font color="#FF0000">*</font></td>                     
  </tr>
  <tr>
    <td class="pad10L" valign="top" height="20">性别：</td>
    <td valign="top" height="20"> <input name="sex" type="radio" value="男" checked onFocus="chImgSrc(this.value)">
      男                       
         <input type="radio" name="sex" value="女" onFocus="chImgSrc(this.value)">女&nbsp; </td>
  </tr>
  <tr>
    <td class="pad10L" valign="top" height="20">OICQ：</td>
    <td valign="top" height="20"> <input type="text" name="qq" id="qq" size="20"> </td>
  </tr>
  <tr> 
    <td class="pad10L" valign="top" height="38"> E-mail：</td>
    <td valign="top" height="38"> <input name="email" type="text" id="email" size="30"> <span id="advance1"> <br>
      <font color="#666666">请输入有效的邮件地址，这将使您能用到问吧中的所有功能。</font> </span></td>
  </tr>
  <tr> 
    <td valign="top" class="pad10L" height="38"> 密码提示问题：</td>
    <td height="38" valign="top"> <input type="text" name="question" id="question" size="20"> 
      <br> <font color="#666666">密码丢失找回密码时使用。</font></td>
  </tr>
  <tr>
    <td valign="top" class="pad10L" height="22"> 密码提示问题答案：</td>
    <td height="22" valign="top"> <input type="text" name="answer" id="answer" size="20"> 
      <br> <font color="#666666">密码丢失找回密码时使用。</font></td>
  </tr>
  <tr>
    <td valign="top" class="pad10L" height="10"> 验证码：</td>
    <td height="10" valign="top"><input type="text" size=3 maxlength=4 name=verifycode> <%Call GetSafeCode%><font color="#666666">请输入图中显示的数字</font></td>
  </tr>
  <tr>
    <td valign="top" class="pad10L" height="15"> 自我简介：</td>
    <td height="15" valign="top"> <textarea  name="jianjie" cols="60" rows="5" wrap="PHYSICAL" id="co">我很懒,什么也不想留下!</textarea> 
      <br> <font color="#666666">最多500个汉字，文字将出现在您的个人介绍页面。（可不填写）</font></td>
  </tr>
</table>
　
<table width="650"  border="0" cellspacing="6" cellpadding="0" align="center">
    <tr>
    <td valign="top" width="185" >&nbsp;</td>
    <td valign="top" align=center width="443">
      <p align="left"><input name="submit" type="submit" id="submit" value="提  交" class="bnsrh">&nbsp;&nbsp;  
      <input name="reset" type="reset" id="reset" value="重新填写" class="bnsrh"></p>
    </td>
  </tr>
</table>
</form>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" style="clear:both;">  <tr>    <td height="30" align=center><!--#include file=end.asp--></td>  
  </tr>
</table>
</body></HTML>