首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

用户注册为何没有反映?哪位高手给个简单的方法?解决能够写入数据库就好

2012-10-18 
用户注册为何没有反映?谁给个简单的方法?解决能够写入数据库就好代码如下;http://127.0.0.1:10322/asp/acc

用户注册为何没有反映?谁给个简单的方法?解决能够写入数据库就好
代码如下;
http://127.0.0.1:10322/asp/account/email/register.asp

VB code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!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=gb2312" /><title>无标题文档</title></head><body><script language = "VBScript">function ChkFields()    name = document.MyForm.user.value   If document.MyForm.UserName.value ="" Then           window.alert("请输入用户名!")           return false   End If   If document.MyForm.pass.value ="" Then           window.alert("请输入密码!")           return false   End If   If document.MyForm.email.value = "" Then           window.alert("请输入电子邮件!")        return false   End If   return trueEnd Function</script><form id="form1" name = "MyForm" method="post" action="save.asp">  <p>用户名    <input name="user" type="text" id="user" />  </p>  <p>邮箱    <input name="email" type="text" id="email" /></p>  <p>    密码      <input name="pass" type="text" id="pass" />  </p>  <p>    确认密码      <input name="pass2" type="text" id="pass2" />      </p>  <p>    <input type="submit" name="Submit" value="提交" onclick = ChkFields()/>    <input type="reset" name="Submit2" value="重置" />  </p></form></body></html>


save.asp
VB code
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="Conn.asp"--><!--#include file = "md5.asp"--><!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=gb2312" /><title>无标题文档</title></head><body><%name=Trim(Request.Form("name"))pass=md5(Trim(Request.Form("pass")))email=Trim(Request.Form("email"))Set rs = server.CreateObject("adodb.recordset")sql="select * from  user name="&name&"  and email="&email&""rs.Open sql, conn, 1,3if rs.eof thenrs.addnewrs(name)=namers(pass)=passrs(email)=emailrs.updateend if %></body></html>


[解决办法]
sql="select * from user name='" & name & "' and email='" & email & "'"

[解决办法]
sql="select * from user where name='" & name & "' and email='" & email & "'"
[解决办法]
sql="select * from user where name='"&name&" ' and email='"&email&"'";

热点排行