tmigliorino
Programmer
- Jan 23, 2002
- 2
In the code below I only get the last 'clientPic', doesn't seem to be creating an array. Should I be using redim in my code?
The customer.asp script is used to display the pictures from the picture names in the 'clientPic' array.
I am using ASP3 not ASP.Net.
<%
dim i, clientLogIn, clientPwd, oRs
clientLogIn = request("clientName")
clientPwd = request("clientPwd")
clientValid = false
i = 0
session("clientPW") = ""
session("clientPic()") = ""
session("clientName") = ""
Set oRs = Server.CreateObject("ADODB.Recordset")
With oRs
.open "qryValidateUserAndPassword", application("appDataSource"), adOpenStatic, adLockOptimistic
do while not .EOF
if lcase(trim(.fields("UserName"))) = lcase(trim(clientLogIn)) then
i = i + 1
session("clientPW") = trim(.fields("Password"))
session("clientPic(i)") = trim(.fields("FileName"))
session("clientName") = trim(.fields("FName"))
if len(trim(.fields("MInitial"))) > 0 then
session("clientName") = session("clientName") & " " & trim(.fields("MInitial"))
end if
session("clientName") = session("clientName") & " " & trim(.fields("LName"))
if lcase(trim(.fields("Password"))) = lcase(trim(clientPwd)) then
clientValid = true
end if
end if
.movenext
loop
if session("clientName") = "" then
session("clientName") = "Unknown User"
elseif clientValid then
response.redirect "customers.asp"
end if
End with
%>
The customer.asp script is used to display the pictures from the picture names in the 'clientPic' array.
I am using ASP3 not ASP.Net.
<%
dim i, clientLogIn, clientPwd, oRs
clientLogIn = request("clientName")
clientPwd = request("clientPwd")
clientValid = false
i = 0
session("clientPW") = ""
session("clientPic()") = ""
session("clientName") = ""
Set oRs = Server.CreateObject("ADODB.Recordset")
With oRs
.open "qryValidateUserAndPassword", application("appDataSource"), adOpenStatic, adLockOptimistic
do while not .EOF
if lcase(trim(.fields("UserName"))) = lcase(trim(clientLogIn)) then
i = i + 1
session("clientPW") = trim(.fields("Password"))
session("clientPic(i)") = trim(.fields("FileName"))
session("clientName") = trim(.fields("FName"))
if len(trim(.fields("MInitial"))) > 0 then
session("clientName") = session("clientName") & " " & trim(.fields("MInitial"))
end if
session("clientName") = session("clientName") & " " & trim(.fields("LName"))
if lcase(trim(.fields("Password"))) = lcase(trim(clientPwd)) then
clientValid = true
end if
end if
.movenext
loop
if session("clientName") = "" then
session("clientName") = "Unknown User"
elseif clientValid then
response.redirect "customers.asp"
end if
End with
%>