|
Posted by Jofio on 11/22/08 11:29
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="counter.txt";
$fh=fopen($visitorFile,"r+") or die("could not open.");
echo 'Debug 1: opened to read';
//read from it
$Visited=fread($fh, filesize($visitorFile)) or die("Could not
read.");
//Add counter to reflect new count
$Visited ++;
//close file
fclose($fh);
echo "your are visitor $Visitor";
?>
Please help.
Jofio
Navigation:
[Reply to this message]
|