asp 获取 本页变量值

来源:百度知道 编辑:UC知道 时间:2024/05/27 08:26:50
<%
dim act,UserName,Old_pwd,New_pwd,Comfirm_pwd
act = Request.form("act")
Old_pwd=Request.form("Old_pwd")
New_pwd=Request.form("New_pwd")
Comfirm_pwd = Request.form("Comfirm_pwd")
if act ="update" then
if len(Old_pwd)<1 or len(New_pwd)<1 or len(Comfirm_pwd)<1 then
alert("请正确输入密码")
end if

if trim(New_pwd)<>trim(Comfirm_pwd) then
alert("新密码与确认密码不一样")
end if

dim user_name
Dim rs
user_name=session("User_ID")
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open"select * from class_list where user_access ='"&user_name&"'",conn,1,3
if rs.recordcount=0 then
alert("用户名不存在")
else
dbname = rs.fields("user_access")
dbpassword = rs.fields("password")
cdbpassword = left(dbpassword,2)

最好把表单域里的代码也发出来看看,不知道你的表单是用什么方式提交的,post?还是get?
你把
act = Request.form("act")
Old_pwd=Request.form("Old_pwd")
New_pwd=Request.form("New_pwd")
Comfirm_pwd = Request.form("Comfirm_pwd")
改成
act = Request("act")
Old_pwd=Request("Old_pwd")
New_pwd=Request("New_pwd")
Comfirm_pwd = Request("Comfirm_pwd")
试试