IanBaker
11-04-2003, 09:33 AM
Hi
I'm having hassles with a login fuinction on my site
What happens is:
The user fills in a form which populates a simple text file/database. They then login using their name and password. Its not working though, from what I can see, the password is including all the fields
Please help
regards
Ian
this is the write line command:
Set writefile = fs.OpenTextFile(filename, 8, True)
writefile.writeline(Request.Form("user_name") & "=" & choice & "," & Request.Form("job_title") & "," & Request.Form("company_name") & "," & Request.Form("address1") & "," & Request.Form("address2") & "," & Request.Form("address3") & "," & Request.Form("email_address") & "," & Request.Form("phone_number"))
writefile.Close
this is the login script:
Sub CheckLogin
redim arrStr(-1)
dim arrTmp
Set fs = CreateObject("Scripting.FileSystemObject")
filename=server.mappath("../../data/bl_survey_2003/survey_2003.bal")
Set readfile=fs.OpenTextFile(filename,1,False)
i = 0
Do until readfile.AtEndOfStream
redim preserve arrStr(i)
arrStr(i) = readfile.readline
i = i + 1
Loop
readfile.close
set readfile=nothing
For a=0 to Ubound(arrStr)
If Instr(arrStr(a), "=") > 0 Then
arrTmp = split(arrStr(a), "=")
If LCase(Request.Form("username")) = trim(LCase(arrTmp(0))) And LCase(Request.Form("userpwd")) = trim(LCase(arrTmp(1))) Then
Session("UserLoggedIn") = "true"
Exit For
End If
End if
Next
I'm having hassles with a login fuinction on my site
What happens is:
The user fills in a form which populates a simple text file/database. They then login using their name and password. Its not working though, from what I can see, the password is including all the fields
Please help
regards
Ian
this is the write line command:
Set writefile = fs.OpenTextFile(filename, 8, True)
writefile.writeline(Request.Form("user_name") & "=" & choice & "," & Request.Form("job_title") & "," & Request.Form("company_name") & "," & Request.Form("address1") & "," & Request.Form("address2") & "," & Request.Form("address3") & "," & Request.Form("email_address") & "," & Request.Form("phone_number"))
writefile.Close
this is the login script:
Sub CheckLogin
redim arrStr(-1)
dim arrTmp
Set fs = CreateObject("Scripting.FileSystemObject")
filename=server.mappath("../../data/bl_survey_2003/survey_2003.bal")
Set readfile=fs.OpenTextFile(filename,1,False)
i = 0
Do until readfile.AtEndOfStream
redim preserve arrStr(i)
arrStr(i) = readfile.readline
i = i + 1
Loop
readfile.close
set readfile=nothing
For a=0 to Ubound(arrStr)
If Instr(arrStr(a), "=") > 0 Then
arrTmp = split(arrStr(a), "=")
If LCase(Request.Form("username")) = trim(LCase(arrTmp(0))) And LCase(Request.Form("userpwd")) = trim(LCase(arrTmp(1))) Then
Session("UserLoggedIn") = "true"
Exit For
End If
End if
Next