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: <?
Did you know?Explore Trending and Topic pages for more stories like this.
$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

private constructor
Hello,

Can we create a constructor as private? If yes, what is the use of it? If no, why can'

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

php global variable
how can we create global variable so we can use its value in any form.. Please give example to

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

MySQL Does not UPDATE- SQLString Problem
vb Syntax (Toggle Plain Text) 1. SQL = "UPDATE sampletable SET column1 = 'C1sample1'"

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily My

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