Novice here so I will try to get this all out right.
Problem:
I want my script to read a file then output that file to a specific location. Got that!
However - the file is a chatfile, it is temporary. When someone has been in the chat, a file is created: a vis file which lists the names of the people in the chat. After a certain amount of time, the file empties, sits for awhile - blank - then deletes and ceases to exist at all.
While the file is there, my script runs beautifully! Does just what is intended. But after the room is empty (which I hope once the site is open wont be often, but does occur from time to time) we have this unsightly error message (shortened because I am long winded enough)
Warning: file(/usr/home/web/users/a0021694/html/cgi-bin/chatfiles/visouter_limits): failed to open stream: No such file or directory
The code I am currently using is in its breif entirety:
<?php
$file = file("/usr/home/web/users/a0021694/html/cgi-bin/chatfiles/visouter_limits");
foreach($file as $line)
echo $line . ', '
?>
What I would like to see is lots of people in the chat, but failing that, I am thinking a nice message saying "No one is here right now" might be better than that big long mean error.
So - being new to this php thing - I am trying to find an answer and am coming up a short.
anyone here have any idea's?