PDA

View Full Version : include() question



tandoc
April 13th, 2002, 06:30
To make my pages seem more organized, i want to make it like http://mysite.com/index.php?page=somepage

but, i also want it to have it's own title.

for example:

in my previous site, i used this code



<?php
if ( $id=='' ) {
$id="/home/a/n/andytandoc/public_html/content/home";
$l="?";
}
else {
$id="$id";
}
?>
<html>
<head>
<title>My site title</title>
</head>
<body>
<?php if (! file_exists("$id.htm"))
{
include("error_page.php");
}
else
{
include("$id.htm");
}
?>
</body>
</html>


the result of that code... gives every page the same title, but i want to know is how to still have that kinda of script, but giving each page it's own title.... like instead of each page being 'My Homepage' i want it like

the downloads page with 'My Homepage - Downloads'
the about me page with 'My Homepage - About Me'

etc etc... do you get what i'm saying?

is0lized
April 13th, 2002, 06:57
how do you get that code to work? im intrested in that code

tandoc
April 13th, 2002, 07:09
i got it to work with one of my other sites... i just got it from HTML-Guru

is0lized
April 13th, 2002, 07:11
no, i mean do you have to edit anything to get it to work or just put it up?

tandoc
April 13th, 2002, 07:18
yea! you need to make a home.htm in a folder names content
and an php file called error_page in the root directory

is0lized
April 13th, 2002, 07:21
i dont get it, send me a pm with more info, so we dont spam the board