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

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

how can i make a .gif images for my site
Dear Friends ,

Pls solve my problem , I am starting making new site but i dont know how can i

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here i

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

PHP/PKI
I am trying to set up a web application that uses pki. does anyone have a good tutorial to set this

Saving PHP output as a file
I wondered if anyone knows how to save the rendered output of a PHP script as a file?

I have

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message s

Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make yo

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