* Thus wrote Harish ([EMAIL PROTECTED]):
>
> Hi
>
> I am using Linux, Apache, MySql, PHP. In the below mentioned code example when the
> counter data that is displayed on the screen going to a indefinite loop. The file
> that is read has got sufficient permissions.
>
> What are the reasons and how do I tackle the problem?
>
> <?php
> $fp = fopen( 't.txt', 'r' );
if ($fp === false) {
die('cant open file');
}
always check the result of an fopen. feof() will only work on a
valid file handle.
$fp = false;
while (!feof($fp) ) {
//infinite loop
}
and you'll never know what hit you if your error_reporting is to
low; ensure that at minimum, E_WARNING is on.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php