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

Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of infor

if description does not contain the following words
Hello everyone,

I am parsing a MS Excel (.xls) file and adding it's content to a mySQL databa

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

PHP Include not working
The website is http://www.grlistingservices.com

The code block is as follows:

<

Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c

help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted de

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