VenomSnake
09-15-2004, 10:37 PM
When I run my ASP login script I get this error message after trying to log in:
Microsoft VBScript runtime error '800a003e'
Input past end of file
/calendar/login.asp, line 17
Here is the app
<!--#include file="config.asp" -->
<%
go = Request.QueryString("go")
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
Set MyTextFile=MyFileObject.OpenTextFile("C:\Inetpub\db\auth.txt")
if Request.Form("username") <> "" then
WHILE NOT MyTextFile.AtEndOfStream
If MyTextFile.ReadLine = "a " & Request.form("username") & " " & Request.form("password") THEN
MyTextFile.Close
Session("DiaryAdmin") = true
If Request.Form("go") <> "" then
Response.Redirect(Request.Form("go"))
Else
Response.Redirect("/member.asp")
End If
Else
If MyTextFile.ReadLine = "u " & Request.form("username") & " " & Request.form("password") THEN
MyTextFile.Close
Session("DiaryUser") = true
If Request.Form("go") <> "" then
Response.Redirect(Request.Form("go"))
Else
Response.Redirect("/member.asp")
End If
Else
msg = "Invalid Username or Password"
End If
End If
go = Request.Form("go")
WEND
MyTextFile.Close
End If
%>
Here is Line 17
If MyTextFile.ReadLine = "u " & Request.form("username") & " " & Request.form("password") THEN
The App works fine with certain user names, but with others it gives the error message. The error also doesn't seem to have any relavence to weather it is a user or admin (a or u at the begining). I have a return at the end of my text file, and the ones that don't work are even between ones that do work, which seems odd to me. Does anyone know what could be wrong? Also, does anything think this method (using a text file for login) isn't a good idea, as I was thinking of trying a database or something if that would work better. Thanks.
Microsoft VBScript runtime error '800a003e'
Input past end of file
/calendar/login.asp, line 17
Here is the app
<!--#include file="config.asp" -->
<%
go = Request.QueryString("go")
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
Set MyTextFile=MyFileObject.OpenTextFile("C:\Inetpub\db\auth.txt")
if Request.Form("username") <> "" then
WHILE NOT MyTextFile.AtEndOfStream
If MyTextFile.ReadLine = "a " & Request.form("username") & " " & Request.form("password") THEN
MyTextFile.Close
Session("DiaryAdmin") = true
If Request.Form("go") <> "" then
Response.Redirect(Request.Form("go"))
Else
Response.Redirect("/member.asp")
End If
Else
If MyTextFile.ReadLine = "u " & Request.form("username") & " " & Request.form("password") THEN
MyTextFile.Close
Session("DiaryUser") = true
If Request.Form("go") <> "" then
Response.Redirect(Request.Form("go"))
Else
Response.Redirect("/member.asp")
End If
Else
msg = "Invalid Username or Password"
End If
End If
go = Request.Form("go")
WEND
MyTextFile.Close
End If
%>
Here is Line 17
If MyTextFile.ReadLine = "u " & Request.form("username") & " " & Request.form("password") THEN
The App works fine with certain user names, but with others it gives the error message. The error also doesn't seem to have any relavence to weather it is a user or admin (a or u at the begining). I have a return at the end of my text file, and the ones that don't work are even between ones that do work, which seems odd to me. Does anyone know what could be wrong? Also, does anything think this method (using a text file for login) isn't a good idea, as I was thinking of trying a database or something if that would work better. Thanks.