Page 1 of 1

can't explain fwrite error

Posted: Wed Oct 28, 2009 8:48 am
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.