<?
if(!file_exists("$page.txt")){
$page = "index";
}
include("$page.txt");
?>
<h2 align="center">Welcome</h2>
<br>
Welcome to my site. Blah blah blah blah blah.
If you would like to contact me, <a href="index.php?contact">Click Here</a>
<h2 align="center">Contact</h2>
<br>
Fill in the following for and hit submit:
<FORM action.....
</FORM>
<?
if($page == "") {
echo "Default crap or include your default page";
} else {
$include = "$page.txt"; //or w/e extention u want
if(file_exists("$include") {
include("$include");
}
else { echo "page aint there! AGGHH"; }
}
?>
<?php
/////////////////////////////////////
// This is 'include.php'
/////////////////////////////////////
$page[0] = "your_default_page.txt";
$page[1] = "another.txt";
$page[2] = "and_another.txt";
?>
<!-- This is you template with all of your HTML etc. -->
<!-- This should be 'index.php' or something
<?php include("include.php"); ?>
<html>
<head>
.
.
.
<?
if(!isset($p))
include($page[0]);
else
include($page[$p]);
?>
.
.
.
</html>
Originally posted by Christopher
It isn't hard, and this way you aren't limited to a couple pages - your whole site uses it, not just 'index' or whatever. Let me in on the less effort way and mabe I'll use it.
But then there isn't a default page compared to the "traditional" script.Originally posted by Christopher
It isn't hard, and this way you aren't limited to a couple pages - your whole site uses it, not just 'index' or whatever. Let me in on the less effort way and mabe I'll use it.