Okay, so you have your website all up.. and you dont want a new html file for every page on your site.. Well there is a simple way to solve this.. heres how..
Step 1: Create a folder called 'pages' in the same folder as your website..
Step 2: Open up your index for your site (make sure the file ends in .php)
Step 3: In your index, Go to the part where your content would be displayed. and put in this code:
- Code:
-
<?
$page = $_GET['page'];
if ($page == '') {
include 'pages/home.php';
} else {
if (file_exists('pages/' . $page . '.php')) {
include 'pages/' . $page . '.php';
} else {
include 'pages/home.php';
}
}
?>
Step 4: In your pages folder make a file called home.php and fill that with your homepage content ex, 'Welcome to the site!'
Step 5. For everypage you want you just make a file in the pages folder called whatever.php
Now once you have done that.. to draw those pages. all you have to do is goto..
http://your website here/index.php?page=the-page-name
Well i hope you guys can understand my weird tutorial >.>