well been working on a few php web sites lately adn run a linking system such as this:
<?
if(isset($page)) {
$idpath = $page."/index.php";
if (file_exists($idpath)) {
include($idpath);
} else {
include('404.htm');
}
} else {
include('content.php');
}
?>
(spacing and all got screwed for some reason :/ )
well anyway that will pull the index.php file from a folder that is passed though a variable in this manner: http://www.website.com?page=blahh will include blahh/index.php in the template and I like how this works however one thing I noticed is that well doing this allows .htaccess files requiring passwords to be bypassed. so if the folder blahh were to have a password on it the index.php file would be completely included without even asking for a password.
any help in either the form of a new way to link files into a template or a fix for this problem would be greatly appreciated
thanks 🙂