求助ASP会员注册确认页面

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:31:55
<%
dim db,conn,myconn
db="../data/infor#mation.mdb" '数据库文件相对路径
Set Conn = Server.CreateObject("ADODB.Connection") '创建对象实例
myconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
Conn.Open MyConn

if request("submit")<>"" then '用户点击提交按钮
username=request("username")
password=request("password")
password_again=request("password_again")
six = request.Form("six")
e-mail = request.Form("e-mail")
question = request.Form("question")
answer = request.Form("answer")
if password<>password_again then
response.write("<script>alert('两次输入的密码不对');window.history.back();</script>")
response.end() '结束运行
end if
set rs=server.CreateObject("adodb.recordset")

没过滤...存在注入,会有安全隐患,另外,我记得,填写的时候默认会有空格...得用TRim把两边的空格给去掉的..
asp略懂...还请高人看下...有无其他修改之处
还有,username=request("username")
password=request("password")
最好用request.form 不要偷懒额..因为request的话直接包含3种提交方式,get cookies post 养成良好的编写习惯,安全隐患也就少了...具体内容网上查下...

水平有限没看出啥明显错误,你自己运行一下就知道了。注册没有提示,如果注册信息为空白,那么也会写进去的,最好写一个判断,if 什么的为空 then 给出提示注册信息不能为空,还有就是写一个FUCTION语句来过滤注册信息里有动态源码写入,防SQL注入