Hi I was just playing with php and found a problem consider this snippet.... $filename = "C:\Program Files\EasyPHP1-8\www\of\example.html"; $htmlcontent=file_get_contents($filename); Code (markup): It works fine but if the example.html file doesn't exist then the server will hang.. i tried this in easy php in vista and was unable to recover from the hang.. I just thought what if the file is executed from the real server So Any good ways to prevent this...?
if (is_file($filename)) { $htmlcontent=file_get_contents($filename); } else { echo 'File not found'; exit(); } PHP: