vbscript - 经典的 asp 发布登录表单不再起作用
问题描述
在网站上工作时,classic asp
我注意到一种行为给某些用户带来了很多麻烦。不知何故,在发布登录表单后,一些密码不再通过,(104) reset connection by peer
尝试访问main.asp
.
这是你们可以帮助我弄清楚的奇怪的事情:
经过几个小时试图找到线索后,我们只是通过将HTML name atribute
from更改name="pwdSenha"
为name="pwdTestSenha"
then 重新开始后的一天,让一切恢复正常,所以我们又更改了一次名称,现在一切正常,但我想只是直到明天。
对发生的事情有解释吗?
这是简化的代码:
<form class="modal-content animate" id="frmLogin" name="frmLogin" method="post" action="../functions/aut_user.asp">
<div class="container">
<label><b>Login</b></label>
<input type="text" placeholder="Entre com Login" name="txtLogin" maxlength="45" required>
<label><b>Senha</b></label>
<input type="password" placeholder="Entre com a Senha" name="pwdSenha" maxlength="15">
<button id="bntLoginEntrar" type="submit">Entrar</button>
</div>
</form>
鉴权类
<%
if funConectaBD() and Session("USER_ID") = "" then
Dim strLogin, strSenha
strLogin = fAspas(Request.Form("txtLogin"))
strSenha = "IS NULL"
if Trim(Request.Form("pwdSenha")) <> "" then
strSenha = "= '" & Cript(Request.Form("pwdSenha")) & "'"
end if
if strLogin <> "" then
'on error resume next
Dim adoRSLogin
Set adoRSLogin = Server.CreateObject("ADODB.Recordset")
adoRSLogin.ActiveConnection = bdConn
Dim strSQL
if Session("USER_CHANGE_PASS") <> "S" then
strSQL = "SELECT * " &_
"FROM users us" &_
"WHERE us.login = '" & strLogin & "' AND us.senha " & strSenha & " AND us.ativo = 'S';"
else
strSQL = "SELECT " &_
"FROM usuario us " &_
"WHERE us.login = '" & strLogin & "' AND us.ativo = 'S';"
end if
'Response.Write(strSQL & "<br/>")
'Response.End()
adoRSLogin.Open(strSQL)
if not adoRSLogin.EOF then
Session("USER_ID") = adoRSLogin("numero")
Session("FUNC_ID") = adoRSLogin("funcionario")
Session("USER_NAME") = adoRSLogin("nome")
Session("FUNC_NAME") = ""
Session("USER_LOGIN") = adoRSLogin("login")
Session("USER_EMAIL") = adoRSLogin("email")
Session("USER_PHONE") = adoRSLogin("telefone")
if adoRSLogin("adm") = "S" then
Session("USER_ADM") = TRUE
else
Session("USER_ADM") = FALSE
end if
Session("UNIT_ID") = adoRSLogin("unidade_numero")
Session("UNIT_NAME") = adoRSLogin("unidade_nome")
strSQL = "CALL inclui_conexao(" & Session("UNIT_ID") & "," & Session("USER_ID") & ",NOW(),NULL);"
'Response.Write(strSQL & "<br/>")
'Response.End
bdConn.execute(strSQL)
'on error goto 0
end if
strSQL = empty
set adoRSLogin = nothing
end if
end if
%>
解决方案
推荐阅读
- java - 如何基于时间多次显示textView
- azure - Azure Blob 存储 - 下载和上传时的内容类型设置
- android - 如何从 imageView 获取图像?
- python - 比较 3 个数组以查找模式和格式化输出
- google-apps-script - 有没有办法使用 Google CalendarApp 脚本从谷歌日历中获取预约空档数据?
- python - 使用 Python 3 和 Numpy 显示每个元素相对于列总数的百分比值的最佳方法是什么?
- asp.net-web-api - 用于批处理操作的 HTTP 动词
- python-3.x - 如何识别变量并从python中的文本文件中分配值?
- laravel - 无法在 Laravel 中添加外键
- android - 在我更改应用程序包名称之前,Android Webview 不会加载网站