My first page is a simple form that passes the username and password to this page after checking it in the database.
I know very little about sql but i want to be able to display other account info on this page after the customer is logged in how would i display the customer number which is stored in cust_no
response.write (display cust_no if userid = username stored in the variable)
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<!-- #include file="Connectionstring.asp" -->
'store form input into variables
frmUsername = Request.Form("username")
frmPassword = Request.Form("password")
'create connection and recordset objects
Set cnStr = Server.CreateObject("ADODB.Connection")
Set rcSet = Server.CreateObject("ADODB.Recordset")
' defining database connection (connectionstring.asp)
cnStr.ConnectionString = path
cnStr.Provider = provider
' execute sql and open as recordset
sqlStr = "Select * From customer where userid = '" _
& Request.Form("username") & "' and password = '" & Request.Form("password") & "'"
' Opens the returned values from the SQL as a recordset, ready for iteration by ASP
set rcSet = cnStr.Execute(sqlStr)
' validate variables against database
If (not rcSet.BOF) and (not rcSet.EOF) then
response.cookies("validated_user") = frmUsername
response.write "<h1>Login successful!</h1>"
response.write "<p>Welcome " & rcSet.fields(1) & "</p>"
response.write "incorrect username and/or password"