Jump to content

How do i add error checking to file_get_contents


eldereth

Recommended Posts

This is the code i currently have

 

	        
<?php
$val = $_GET['skill'] . '.html';
?> 
  <?php
$homepage = file_get_contents($val);
echo $homepage
?>

 

And all im wanting to do is if file_get_contents = false to say 'Sorry, the file was not found'. if true to do the echo as above

 

thankyou very much

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.