Close a file you have opened with fopen( ), use fclose( ).
<? $filename = 'data.txt'; $handle = fopen($filename, "rb"); $contents = fread($handle, filesize($filename)); fclose($handle); print $contents; ?>