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

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

Libraries in C++
Hi all,

I have two libraries. one is based targeted on linux platform and uses another li

How to know if online site made with PHP
Hello,
I see some sites that does not display extensions at all , for example:

www.site.co

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

Weird Problem with curl while sending data
I am facing a weird problem with sending data to a site via curl.

If i send the value by this

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

Limiting uploaded file type
Hi. First post here
I am working on a simple upload script, and I need it to limit the allowed f

PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the passw

My XSRF Prevention code isn't working
First of all, thanks for the generous help you guys have given me in the past on this forum.
Seco

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

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