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


drythirst
09-27-2004, 10:04 AM
OK, i got a parse error on line 2 of this code:
I was wondering if any of you could see what might be wrong.

<?php
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

?>


Thanks in advance!!

Jona
09-27-2004, 10:28 AM
Um, that's ASP not PHP. :rolleyes:

drythirst
09-27-2004, 11:06 AM
oooh maybe thats the prob LOL

drythirst
09-27-2004, 11:43 AM
Well I'm Still having problems w/ it.......


HELP

Hellspire
09-27-2004, 11:46 AM
Think! If its ASP coding and your passing it through a PHP block... dont you think that you'll get a parse error............. :rolleyes:

Jona
09-27-2004, 12:09 PM
Ask in the ASP forum; your script looks fine to me. Maybe you should try giving the new error message as well...

drythirst
09-27-2004, 02:18 PM
the error message never changed

i dont think that as far as the browser got, it made a difference. if it gets an error on line two, it stops at line two. heck there could be a problem on line 4 and i wouldnt know it until i fixed line 2.

MstrBob
09-27-2004, 02:21 PM
Browsers don't read server side scripts, servers interpret it. ;)

If it's ASP, it should be used on an ASP page, on a server that uses ASP, with proper ASP syntax. And the question should then be asked in the ASP forum. If however, you have PHP code with which to seek our help, we can only do so if we see the PHP source. ;)

drythirst
09-30-2004, 05:09 PM
well i meant server***** cuz ....well ya

solavar
09-30-2004, 06:36 PM
Remember, with PHP, you must terminate the statement with a semicolon.

That's the source of error!


*** edit ***


Asking PHP to parse ASP code is a new one on me.

:confused:

drythirst
09-30-2004, 07:04 PM
terminate what statement???
like where does the semicolon go?

Paul Jr
09-30-2004, 08:27 PM
This thread has no point. You are trying to write ASP code within PHP start and end tags — that isn’t going to work no matter which way you do it. Swap out the PHP start and end tags for ASP tags (<% and %>), then see if the code works. If it does not, ask in the ASP forum.

Jona
09-30-2004, 08:39 PM
I agree with Paul. This thread is old and useless; I keep getting messages in my inbox saying someone has replied to it, and each time I see the replies are completely irrelevant and as useless as the original post. This thread should be locked. It isn't doing anyone any good.