我自己写的聊天室源代码(五)

发表于:2007-06-30来源:作者:点击数: 标签:
****************************用户修改**************************** %‘’updateuser.asp% %response.buffer = true% html head meta http-equiv=Content-Type content=text/html; charset=gb2312 title用户修改/title meta name=GENERATOR content=Microsof
****************************用户修改****************************
<%‘’updateuser.asp%>
<%response.buffer = true%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户修改</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<script language="JavaScript"><!--
function dd(list)
{
var listtext="";
if ((list.selectedIndex != -1)&&(list.selectedIndex != 0))
    listtext = list.options[list.selectedIndex].value;
document.forms[0].sex.value = listtext
return true;
}
function windowload()
{
document.forms[0].name.focus();
}
function formsubmit()
{
document.forms[0].submit();
}
function mm(text)
{
var aa=""
if (text==1)
    aa=document.forms[0].name.value
if (text==2)
    aa=document.forms[0].sex.value
if (text==3)
    aa=document.forms[0].pass.value
if (text==4)
    aa=document.forms[0].pass1.value
if (text==5)
    aa=document.forms[0].oldpass.value
return aa;
}
function msg(text)
{
alert(text);
return;
}
// --></script>
<script language="VBScript"><!--
function input(tt)
    dim sc_name,sc_sex,sc_pass,sc_pass1,sc_flag,sc_oldpass
    sc_flag = 0
    ‘’姓名
    sc_name = ""
    sc_name = trim(mm(1))
    if sc_name = "" then
        msg("必须输入:您的昵称")
        sc_flag = 1
    end if
    sc_oldpass = ""
    sc_oldpass = mm(5)
    if sc_oldpass = "" then
        msg("必须输入:您的口令")
        sc_flag = 1
    end if
    sc_sex = ""
    sc_sex = trim(mm(2))
    if sc_sex = "" then
        msg("必须输入:您的新性别")
        sc_flag = 1
    end if
    sc_pass = ""
    sc_pass = mm(3)
    if sc_pass = "" then
        msg("必须输入:您的新口令")
        sc_flag = 1
    end if
    sc_pass1 = ""
    sc_pass1 = mm(4)
    if sc_pass1 = "" then
        msg("必须输入:新确认口令")
        sc_flag = 1
    end if
    if sc_pass <> sc_pass1 then
        msg("新口令和新确认口令不一致")
        sc_flag = 1
    end if
    if sc_flag = 0 then
        formsubmit()
    else
        windowload()
    end if
end function
--></script>

<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>

<body onload="windowload();">

<form method="POST" action="updateusercl.asp">
  <input type="hidden" name="flag" value=" "><table border="0" width="100%" cellspacing="0">
    <tr>
      <td width="100%" align="right" colspan="2"><div align="center"><center><p><img
      src="images/edit.jpg" alt="register.jpg (6042 bytes)" WIDTH="367" HEIGHT="121"></td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的昵称:</td>
      <td width="50%"><div align="left"><p><input type="text" name="name" size="20"
      maxlength="20">(必须填写,不能有空格)</td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的口令:</td>
      <td width="50%"><div align="left"><p><input type="text" name="oldpass" size="20"></td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的新性别:</td>
      <td width="50%"><div align="left"><p><select name="D1" size="1" onchange="dd(this);">
        <option selected value="自填 ">自填</option>
        <option value="俊男">俊男</option>
        <option value="美女">美女</option>
        <option value="精灵">精灵</option>
        <option value="野兽">野兽</option>
      </select><input type="text" name="sex" size="12">(必须填写)</td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的新口令:</td>
      <td width="50%"><div align="left"><p><input type="text" name="pass" size="20">(必须填写)</td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">新口令确认:</td>
      <td width="50%"><div align="left"><p><input type="text" name="pass1" size="20">(必须填写)</td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的新提示问题:</td>
      <td width="50%"><div align="left"><p><input type="text" name="quesstion" size="20"></td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">新提示问题答案:</td>
      <td width="50%"><div align="left"><p><input type="text" name="answer" size="20"></td>
    </tr>
    <tr align="center">
      <td width="50%" align="right">您的新E_mail:</td>
      <td width="50%"><div align="left"><p><input type="text" name="email" size="20"></td>
    </tr>
    <tr align="center">
      <td width="50%" align="right"></td>
      <td width="50%"></td>
    </tr>
    <tr align="center">
      <td width="50%"><div align="right"><p><input type="button" value="改完了" name="B1"
      language="vbscript" onclick="input(this)"></td>
      <td width="50%"><div align="left"><p><input type="reset" value="重新改" name="B2"></td>
    </tr>
  </table>
</form>
</body>
</html>
*****************************修改处理********************************
<%‘’updateusercl.asp%>
<%response.buffer = true%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改处理</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<%
dim sc_name,sc_sex,sc_pass,sc_quesstion,sc_answer,sc_email,sc_ip,sc_flag,sc_oldpass,dd
sc_oldpass = request.form("oldpass")
sc_ip = request.servervariables("remote_addr")
sc_name = replace(trim(request.form("name")),"<","<")
sc_sex = replace(trim(request.form("sex")),"<","<")
sc_pass = request.form("pass")
sc_quesstion = request.form("quesstion")
sc_answer = request.form("answer")
sc_email = request.form("email")
set conn=server.createobject("adodb.connection")
conn.open "chat","chat","chat001"
sc_flag = 0
‘’账号不存在
sql1 = "select user_password from user_info_table where user_name = ‘’" + sc_name + "‘’"
set rs=conn.execute(sql1)
if rs.eof then
    sc_flag = 1
else
‘’口令不对
    if trim(sc_oldpass) <> trim(rs(0)) then
        sc_flag = 2
    end if    
end if
rs.close
if sc_flag = 0 then
    sql1 = "update user_info_table set user_password=‘’" + sc_pass + "‘’,user_sex=‘’" + sc_sex +"‘’,user_email=‘’" + sc_email +"‘’,user_quesstion=‘’" + sc_quesstion + "‘’,user_answer=‘’" + sc_answer + "‘’ where user_name=‘’" + sc_name + "‘’"
    set rs1 = conn.execute(sql1)
end if
conn.close
select case sc_flag
    case 0
        response.redirect "updateuserok.asp"
    case 1
        response.redirect "updateuserno.asp"
    case 2
        response.redirect "updateuserps.asp"
end select
%>

<body>
</body>
</html>
****************************修改成功*******************************
<%‘’updateuserok.asp%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改成功</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>

<body>

<p align="center"><img src="images/jxw_ok.gif" alt="jxw_ok.gif (2182 bytes)" WIDTH="120"
HEIGHT="145"><font face="隶书" color="#FF00FF"><big><big>修改成功!!请登录聊天室!</big></big></font></p>

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan --><div
  align="center"><center><p><input type="button" value="关闭" name="B1"
  onclick="window.close();"></p>
  </center></div>
</form>
</body>
</html>
********************************账号不存在*******************************
<%‘’updateuserno.asp%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>账号不存在</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<script language="JavaScript"><!--
function good()
{
location.href = "insertuser.asp";
}
function closewindow()
{
window.close();
}
// --></script>

<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>

<body>

<p align="center"><img src="images/jxw_fail.gif" width="120" height="145"
alt="jxw_fail.gif (2499 bytes)"><font face="隶书" color="#FF00FF"><big><big>账号不存在!!登录一个好吗?</big></big></font></p>

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan --><div
  align="center"><center><p><input type="button" value="好的" name="B1" onclick="good();"><input
  type="button" value="不好" name="B2" onclick="closewindow();"></p>
  </center></div>
</form>
</body>
</html>
****************************口令不正确*******************************
<%‘’updateuserps.asp%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>口令不正确</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>

<body>

<p align="center"><img src="images/jxw_fail.gif" alt="jxw_fail.gif (2499 bytes)"
WIDTH="120" HEIGHT="145"><font face="隶书" color="#FF00FF"><big><big>难道口令不正确?!</big></big></font></p>

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan --><div
  align="center"><center><p><input type="button" value="继续改" name="B2"
  onclick="location.href=‘’updateuser.asp‘’;"><input type="button" value="不改了" name="B1"
  onclick="window.close();"></p>
  </center></div>
</form>
</body>
</html>

原文转自:http://www.ltesting.net