YourDirector
07-12-2011, 11:44 AM
Hey everyone,
I'm building a website in PHP where the header and footer are built into the index.php file, inbetween them is a cell in which all the other content for the website is loaded from external files.
I currently do this by adding:
<?
echo $content
?>
into the aforementioned cell, then before the head of the index page having this for each page on the site:
if (isset($HTTP_GET_VARS["home"])){
$content = file_get_contents("data/home.dat");
}
To call this I simply have my hyperlinks set to "/?home" etc.
While this works, with a large site you can imagine the list of above commands gets pretty weighty. I know this is a really terrible way to do this but I don't know any other way.
Can anyone point me towards a better way of loading external html content into my PHP page, variably dependant on the link just clicked by the user?
Thanks
I'm building a website in PHP where the header and footer are built into the index.php file, inbetween them is a cell in which all the other content for the website is loaded from external files.
I currently do this by adding:
<?
echo $content
?>
into the aforementioned cell, then before the head of the index page having this for each page on the site:
if (isset($HTTP_GET_VARS["home"])){
$content = file_get_contents("data/home.dat");
}
To call this I simply have my hyperlinks set to "/?home" etc.
While this works, with a large site you can imagine the list of above commands gets pretty weighty. I know this is a really terrible way to do this but I don't know any other way.
Can anyone point me towards a better way of loading external html content into my PHP page, variably dependant on the link just clicked by the user?
Thanks