当前位置: 代码迷 >> Lotus >> ASP+SQL数据库完整的登陆系统例子
  详细解决方案

ASP+SQL数据库完整的登陆系统例子

热度:67   发布时间:2016-05-05 07:05:54.0
求一个ASP+SQL数据库完整的登陆系统例子
谢谢

------解决方案--------------------
该帖不适合在此发表,请转移到ASP开发社区。
------解决方案--------------------
其实LotusScript即Asp,Asp即LotusScript.不过使用ASP+SQL你要考虑更多的系统安全问题,最普遍的一个就是防止溢出和SQL注入攻击.
下面给出最简单的登陆验证代码,你要自己做其他安全检查的代码.
<[email protected]=Vbscript%>
<%
dim Uid
dim Pwd

Uid=Request.Form( "UserName ")
Pwd=Request.Form( "Password ")

set Conn=Server.CreateObject( "Adodb.Connection ")
Conn.Open "Driver=Sql Server;Server=DataCenter;Uid=Sa;Pwd= ' ';Database=UsrInfo "
set RS=Server.CreateObject( "Adodb.RecordSet ")
Call RS.Open "select * from User where UID= ' " & Uid & " ' & Pwd= ' " & Pwd & " ' " , Conn
if RS.RecordCount> 0 then
Response.Write "Login successfully "
Session( "Uid ")=RS( "Uid ")
else
Response.Write "Login in failure "
Session( "Uid ")= " "
End if

%>

  相关解决方案