DanUK
10-26-2003, 10:21 AM
Hello there.
I was just wondering if this was achieveable with PHP itself, I have my site (at last) running 90% as I want it to.
However, I want to add a new directory called "staff" where a login box will appear (much like when you use FTP), and if that login fails, it won't let them view that directory.
At the moment, in the content files I have, I have the following PHP:
<?php
if (!eregi("page.php", $_SERVER['PHP_SELF'])) {
die ("Sorry, You cannot access this file directly...");
}
$index = 0;
include("header.php");
?>
<div align="center">
HTML content.
</div>
<?php
include("footer.php");
?>
Or is it best to just use .htaccess for this?
Many thanks if you can help.
I was just wondering if this was achieveable with PHP itself, I have my site (at last) running 90% as I want it to.
However, I want to add a new directory called "staff" where a login box will appear (much like when you use FTP), and if that login fails, it won't let them view that directory.
At the moment, in the content files I have, I have the following PHP:
<?php
if (!eregi("page.php", $_SERVER['PHP_SELF'])) {
die ("Sorry, You cannot access this file directly...");
}
$index = 0;
include("header.php");
?>
<div align="center">
HTML content.
</div>
<?php
include("footer.php");
?>
Or is it best to just use .htaccess for this?
Many thanks if you can help.