Reply to Simple text file reading codes NOT working

Your name:

Reply:


Posted by Jofio on 11/13/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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация