this will explain things well
PHP Setup.
Specs:
Skill: Medium to advanced
Tools: Dreamweaver *Reccomended*
any html editor or notepad will do.
Time: 30 minutes to an hourAre you tired of updating ten hundred pages when ever a link chages? Then STOP!
Imakuni? is here to help you!
First change your index.html to index.php. Make sure your host supports php codes (If you dont have php the index.php file would work but the below code wouldnt.)
Now Copy
Code:
<?php
if(isset($_GET['id']))
{
$id=$_GET['id'];
if(is_file($id . ".php"))
{
include $id . ".php";
}
else
{
if(is_file($id . ".html"))
{
include $id . ".html";
}
else include "404.html";
}
}
else include "[i]main.html[/i]";
?>
Into where you want your content to appear. Then make a html page called "main.html". If you have a news program or dont want main.html then change the page the page that I put in italics to the url of what you want to appear there. That will be what shows up in the index.php.
You think your done yes? No your not now to make special links.
You have to change all the link to index.php?id=nameofpage for ex.
Lets say i have a page called ruby.php i would take the name of the page
(ruby), with out the .php and add that after id, so it would be index.php?id=ruby and uses that as the link One last thing you would have to change one thing in index.php (well maybe) if your main page is main.html done change nothing but if your mainpage is main.php in index.php where it says
Code:
else include "[i]main.html[/i]";
If its NOT main.html change it to the page you want to include.
change it to main.php that's the only thing you will need to change in the index.php. If it is main.php it will say
Code:
else include "[i]main.php[/i]";
If its NOT main.php change it to the page you want to include.
if you need a php host try t35.com or hostultra.com