can't explain fwrite error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
daktau
Forum Newbie
Posts: 3
Joined: Wed Oct 28, 2009 7:07 am

can't explain fwrite error

Post by daktau »

Hi All,
Does anyone know what is causing the error in this code?

<?
$errorLog_FilePath = "error_log.txt";
$handle = @fopen($errorLog_FilePath,'a+');
$strError = "hi!";
if(!fwrite($handle, $strError)){ //this is line 5
     echo('Cannot write to file');
}
?>

I get:
Parse error: syntax error, unexpected T_VARIABLE on line 5

I can't understand what is wrong with it.

thanks a lot,
George.
Post Reply