fwrite error


Posted on 16th Feb 2014 07:03 pm by admin

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

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.

No comments posted yet

Your Answer:

Login to answer
206 Like 25 Dislike
Previous forums Next forums
Other forums

Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h

Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as

Feed Maker
Hi all.
First of all I must say I am not a php developer so I am afraid I don't know much about i

rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

value not going in data base
hello friends....
i am having a working javascript....when i am selecting any

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

Problems with adding a link to one position in a 'foreach' loop, please help
Hello!

Iam pretty new to programming and I wanna create a table with users from an array. It

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash