<% dim rs,sql,username,regcode,active,password,founderr,msg username=trim(request("name")) password=trim(request("password")) if username="" then founderr=true msg="username参数无效!" else founderr=false end if if password="" then founderr=true msg="password参数无效!" else founderr=false end if
if founderr=true then response.write msg else set rs=Server.CreateObject("ADODB.RecordSet") sql="select * from reguser where username='"&username&"' and password='"&password&"'" rs.open sql,conn,1,1 if rs.recordcount>0 then if trim(rs("regcode"))<>"" then response.write rs("regcode") else response.write "返回的用户注册码无效!" end if else response.write "输入的用户名不存在或者密码无效!" end if rs.close set rs=nothing end if