I'd recommend a 404 over a 403 considering a 403 proves there is something worth hacking into.
index.php:
define('isdoc',1);
include('includes/include.sqlfunctions.php');
// Rest of code for index.php
?>
include.sqlfunctions.php (or other include file):
if(isdoc !== 1) // Not identical to 1
{
header('HTTP/1.1 404 Not Found');
echo "\n\n404 Not Found \n";
echo "\nNot Found
\nThe requested URL "
.$_SERVER['REQUEST_URI']." was not found on this server.\n";
echo "
\n".$_SERVER['SERVER_SIGNATURE']."\n\n";
// Echo output similar to Apache's default 404 (if thats what you're using)
exit;
}
// Rest of code for this include
?>