Click to See Complete Forum and Search --> : Parse Error: Line two


drythirst
09-30-2004, 06:13 PM
I got a parse error on line two. I don't know what is wrong with the code. Maybe some of you ASPhreaks (lol no, jk ASP scripters) could help me. I will comment out a part with the line showing the prob.


<%
dim filesys, filetxt
# THIS LINE^^^
Const ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile(Server.MapPath("/ip_log.txt"), ForAppending, True)
filetxt.WriteLine("<p>")
filetxt.WriteLine("IP=" & Request.ServerVariables("REMOTE_ADDR"))
filetxt.WriteLine("<br>")
filetxt.WriteLine("Date: " & Date() & " at " & Time() &".")
filetxt.WriteLine("<br>")
filetxt.WriteLine("HTTP_USER_AGENT=" & Request.ServerVariables("HTTP_USER_AGENT"))
filetxt.WriteLine("<br>")
filetxt.WriteLine("HTTP_REFERER=" & Request.ServerVariables("HTTP_REFERER"))
filetxt.WriteLine("</p>")
filetxt.Close
Set filetxt = Nothing
Set filesys = Nothing

%>

buntine
10-01-2004, 01:35 AM
Your code looks fine. Unless your actually trying to the # as a comment initiator in VBScript. You need to use a single quote (').

Can you post the actual error message?

Regards.

drythirst
10-02-2004, 09:42 AM
Well actually, the 3rd Line (# this line^^^) isn't actually in the script. So, the problem is on line two.
The error message is:

Parse error: Parse error on line 2


edit---You can check it here: http://neutrai.freeserverhost.com/datforum/search.php