NYCPHP Meetup

NYPHP.org

[nycphp-talk] include called twice

nyphp at jimbishop.org nyphp at jimbishop.org
Tue Jun 18 17:10:38 EDT 2002


when you use @readfile to test for the file, it actually loads the
file.  use is_file(/path/to/file) instead.





> I want the following code to see if a file is present, 6then include it if it 
> is. I use3d the @ to supress an error if the file is not present. It works, but 
> mysteriously writes the file to the page TWICE. I tried require() instead and 
> the same results. Why is this? Thanks.
> 
> $file-location = /path/to/file/;
> 
> if (@readfile($file-location) != FALSE) {
> include($file-location);
> }
> 
> 
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> 
> 





|| jim.bishop
|| i heart n y
|| http://www.jimbishop.org/tidbytes/





More information about the talk mailing list