• 0

Script return errors


Question

How can i make it so when like i can include a file but if the file returns a error it dosent include insted it echos a some text...

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

or if you want it to continue to load, but not show the errors...


$file='/path/to/file';

include($file) || echo "Couldn't load $file ! Sorry :(";

Link to comment
Share on other sites

  • 0

$file = "/path/to/file";

if(fileexists($file)){
include $file;
}else{
echo "the file could not be included - it does not exist";
}

That what you mean?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.