Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with fwrite()....Not writing

Status
Not open for further replies.

james0816

Programmer
Jan 9, 2003
295
US
I have created a text file and now am trying to write to it. Simple enough...so I thought...but nothing is getting written.

$lfile=date("Ymd")."Out.txt";
if (file_exists($lfile)) {
fopen($lfile,'w') or die ("Can't Open Log File");
$lstring="HI!";
fwrite($lfile, $lstring);
fclose($lfile);
}

Full rights are granted.

Am I missing something here?
 
yep....missed the file handler

$fh = fopen($lfile,'w') or die ("Can't Open Log File"); $lstring="HI!";
fwrite($fh, $lstring);
fclose($fh);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top