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

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

Create a form of 2 numbers input and find the greatest.
Hi, everybody.

I have a homework in my training of php, which ask you to make a form that ask

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

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

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

PHP - MySQL Fail
My PHP code will only execute the first part of my code...

Code: <?php

sessio

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

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