Generally speaking is it better to use require than include for security? I know they are exactly the same except for how they handle when they fail. Is it better to stop the script rather than letting it continue with an error?
Or is it best to use something like this script I just thought of...
ini_set('display_errors', 0);
if(!include('includes/top.php'))
{
echo 'Sorry the page contains errors, contact support';
die();
}
I suppose it does depend on what exactly you are 'including' but if you do have errors displayed, isn't that sort of a security risk? 😕
I think I will use the script I just thought of writing this post though, its pretty good 😃 HAR! 🆒