A
Anonymous
Guest
This is a slimmed down bit of PHP code that I use to make the sites that I make.
The nav links to other pages would be similar to this code
The text files that get included to make up the different pages of the site can be in the main docroot directory, in a subdirectory, or be in another 'parent' directory. These text files can be made up of any combination of J/S, PHP, HTML, or just plain old text. CSS can be used to make all this look nice..
Code:
<?
include("menu.txt");
if (!isset($_GET['page'])) {
include("mainpage.txt");
exit;
}
if (file_exists($_GET['page'] . ".txt")) {
echo "<script type='text/javascript'>document.title='Website - " . ucfirst($_GET['page']) . "';</script>";
include($_GET['page'] . ".txt");
exit;
} else {
include("404errorpage.txt");
exit;
}
}
?>
Code:
<a href="?page=about">About</a>