Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error.

Status
Not open for further replies.

Bjelleklang

Programmer
Joined
Sep 2, 2003
Messages
8
Location
NO
I get a parse error on line 12 when i run this script, but I cant find anything wrong with it. Can someone help me???

<?php


$name = str_replace (&quot;\t&quot; , &quot; &quot; , $_GET['name']);
$mail = str_replace (&quot;\t&quot; , &quot; &quot; , $_GET['mail']);
$country= str_replace (&quot;\t&quot; , &quot; &quot; , $_GET['country']);
$comment = str_replace (&quot;\t&quot; , &quot; &quot; , $_GET['comment']);
$dato= date(&quot;I dS of F Y H:i:s&quot;)


//THIS IS THE LINE!!!!!
$datafile=&quot;guests.list&quot;;



if ($fp==false)
die(&quot;Cant open file. \r\n&quot;);


//Vil legge inn etter custom tag i gjesteboka. Hvis mulig, rett inn i html fila,
//samt registrere i statsfil hvor avsender er fra.
$fp = fopen($datafile, &quot;r+&quot;);


fwrite ($fp, &quot;<P>&quot; . &quot;Name:&quot; . &quot;\t&quot; . $name . &quot;</BR>&quot; . &quot;Date: &quot; . &quot;\t&quot; . $dato . &quot;/BR&quot; . &quot;E-mail address:&quot; . &quot;<\t>&quot; . $mail . &quot;</BR>&quot; . &quot;Comment:&quot; . &quot;\t&quot; . &quot;&quot;. $comment . &quot;</BR><HR></BR></P>&quot;);
fclose ($fp);
?>

 
U forgot &quot;;&quot; on
Code:
$dato= date(&quot;I dS of F Y H:i:s&quot;)

The parse error not always exactly point out the problem line.
It can be anywhere between start of the script and the line mentioned in the parse error.




--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Thanks. I didn't know that it didnt point to the exact line.

Thanks.
 
&quot;Parse error&quot; means that the PHP interpreter is confused. When PHP reports a parse error, it reports the line number at which it realizes it is confused. This line is not necessarily where the error occurred that began the confusion.

I have some advice on parse errors in section 2.3 of my FAQ: faq434-2999

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top