Ok so Mahngiel, hope I spelt that right. I did some rethinking after reading what you have said, and did some research on functions and peramiters. I am currently reviewing a small tutorial, and although some if it is making sense, I was hoping you can disect it fore me. Or anyone for that matter, once I understand it, I will be able to use it. I have linked the tutorial incase you need to see the structure of things.
http://www.zeronese.net/knowledge-base/articles/article-1029.html
<?php
if(isset($_REQUEST['page']))
{
if($_REQUEST['page'] !="")
if(file_exists("pages/".$_REQUEST['page'].".html"))
$page_content = file_get_contents("pages/".$_REQUEST['page'].".html");
else
if (file_exists($_REQUEST['page'].".html"))
$page_content=file_get_contents($_REQUEST['page'].".html");
else
echo "<center>Page: ".$_REQUEST['page']." does not exist! Please check the url and try again!</center>";
}
else
$page_content=file_get_contents("design/pages/main.html");
$page_content=str_replace("!!HEADER!!",file_get_contents("design/header.html"), $page_content);
$page_content=str_replace("!!LEFT_COLUMN!!", file_get_contents("design/left_column.html"),$page_content);
$page_content=str_replace("!!RIGHT_COLUMN!!",file_get_contents("design/right_column.html"),$page_content);
$page_content=str_replace("!!FOOTER!!",file_get_contents("design/footer.html"),$page_content);
echo $page_content;
?>
on the first line of code
if(isset($_REQUEST['page']))
if(file_exists("pages/.$_REQUEST['page'].".html"))
I think it checks weather the "page" is not null. But where is it checking this at? I mean where would 'page' come from its the same for the second line as well. I know its going to check for the existence of a file in the pages subfolder, so right now the only one it can be is "main" but again, the 'page' where is that declared, or defined?
Once I figure out where the 'page' is comeing from I think I will be able to understand how I can use this.