为什磨sql取出的 password<>表单提交的password(100分)

  • 主题发起人 主题发起人 zblichao
  • 开始时间 开始时间
Z

zblichao

Unregistered / Unconfirmed
GUEST, unregistred user!
我在sql的数据库中的password=123 表单提交的password也是123
为什磨sql取出的 password 不等于表单提交的password 是不是数据类型不同?
<% @ language=vbscript%>
<!-- #include virtual="/try/gen.inc" -->
<%
dim username
dim password
dim datacon
dim rs
username=request.form("username")
password=request.form("password")
set datacon=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
datacon.connectiontimeout=20
datacon.open"dsn=login","login","login"
if Request("sel_main")=5 then
sqlquery="select * from login_admin where username="&amp;sqlstr(username)
set rs=datacon.execute(sqlquery,nrow)
if rs.eof=true then
response.write("usernameerror")
end if
if rs("password")=password then
response.write("passworderror")
end if
response.redirect "index.htm"
end if
%>
 
加trim试试(去掉sql记录和表单中的前后空格)
 
谢谢问题已经解决了,100我已经给你了!!希望能跟你交个朋友
 
后退
顶部