2013年9月6日 星期五

asp-mssql-read

<%  
p_username = Request.form("p_username")
p_password = Request.form("p_password")
p_save = Request.form("p_save")
set outpostDB = Server.CreateObject("ADODB.Connection")
outpostDB.Open "outpost"
sqlText="select * from members where username='"&p_username &"'"
set userSet = outpostDB.Execute(sqlText)
if userSet.EOF then
Response.Redirect " /login.asp?retry=username"
else
real_password = trim(userSet("password"))
if p_password = real_password then
Response.cookies("isLoggedInAs")("username") = p_username
Response.cookies("isLoggedInAs")("first_name") = userSet("first_name")
if p_save = "yes" then
Response.cookies("isLoggedInAs").expires =_
   #December 31, 2001 00:00:00#
end if
else
'Username is good, but password is wrong
Response.Redirect "http://localhost/login.asp?retry=password"
end if
end if
 %>

沒有留言:

張貼留言