Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'Save the entered username and password
Usernametx = Request.Form("txtUsername")
Passwordtx = Request.Form("txtPassword")
'Build connection with database
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "DSN=mydsn;UID=user;PWD=mypassword"
set rs = server.CreateObject ("ADODB.Recordset")
'Open record with entered username
rs.Open "SELECT * FROM mydb where trim(username)='"& Usernametx &"'", conn, 1
Response.Cookies("ValidUser") = Validated
'If there is no record with the entered username, close connection
'and go back to login with QueryString
If rs.recordcount = 0 then
rs.close
conn.close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=namefailed")
end if
'If entered password is right, close connection and open mainpage
if trim(rs("password")) = Passwordtx then
Session("Username") = Usernametx
Response.Redirect(RS("mypage.asp"))
'If entered password is wrong, close connection
'and return to login with QueryString
else
rs.Close
conn.Close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=passfailed")
end if
Usernametx = trim(Request.Form("txtUsername") )
Passwordtx = trim(Request.Form("txtPassword"))
"SELECT * FROM mydb where trim(username)='"& trim(Usernametx) &"'", conn, 1