1. index.php
define('SECURE_PAGE', true);
include 'header.php';
//all data of index page
?>
2.header.php (Show error that Direct File Access Prohibited)
if (!defined('SECURE_PAGE'))
{
die('<h1>Direct File Access Prohibited</h1>');
}
2.header.php (Redirect to homepage)
<?php
if (!defined('SECURE_PAGE'))
{
header('Location: ./');
}
?>
0 Comments