My PHP code to read a simple text file is listed below. What could have
gone wrong here? When I run it, the browser displays: 'COULD NOT Read'
opton of the fread() function. I thought the code was OK.
<?php
$visitorFile="c ounter.txt";
$fh=fopen($visi torFile,"r+") or die("could not open.");
echo 'Debug 1: opened to read';
//read from it
$Visited=fread( $fh, filesize($visit orFile)) or die("Could not
read.");
//Add counter to reflect new count
$Visited ++;
//close file
fclose($fh);
echo "your are visitor $Visitor";
?>
Please help.
Jofio
gone wrong here? When I run it, the browser displays: 'COULD NOT Read'
opton of the fread() function. I thought the code was OK.
<?php
$visitorFile="c ounter.txt";
$fh=fopen($visi torFile,"r+") or die("could not open.");
echo 'Debug 1: opened to read';
//read from it
$Visited=fread( $fh, filesize($visit orFile)) or die("Could not
read.");
//Add counter to reflect new count
$Visited ++;
//close file
fclose($fh);
echo "your are visitor $Visitor";
?>
Please help.
Jofio
Comment