gateway.asp has few ASP code above the HTML code that I have given you as follows.
Code:
<%
Dim id, password, query, recordset, d
id = Request.Form ("id")
password = Request.Form ("password")
'** Create your Query
query = "SELECT * FROM password WHERE id LIKE '" & _
id & "'AND password LIKE'" & password & "'"
'** Create a RecordSet to store the results of the query
Set recordset = Server.CreateObject ("ADODB.Recordset")
recordset.Open query, "DSN = xxxxxx;"
'** Check for no records returned (id or password not found)
then if NOT recordset.EOF
'** Set cookies for user's convenience
d = Date
Response.Cookies ("userid") = id
Response.Cookies ("pword") = password
Response.Cookies ("userid"). Expires = DateAdd ("yyyy", 2, d)
Response.Cookies ("pword"). Expires = DateAdd ("yyyy", 2, d)
end if
%>
<html>
In this page, the form fields are populated with a bit of simple ASP code on example of Which follows:
Code:
<Input type = "text" size = "20" name = "password" value = "<% = Request.Cookies (" pword ")%>">
Note: for the purposes of security, you may not want to store the password in a cookie. However, storing the user ID can be convenient.
Bookmarks