This is something i've been trying to get working on my site for a while but only got the oppertunity lately.
To get a general idea, im separating the logic of my site from the HTML content and using a single index.php file.
I'd like to use a system where the Index includes the appropriate html document based on the URL.. example:
http://www.my-site.com/index.php?page=home
(must include "includes/home.html" page)
I've tried using:
<?php echo 'includes/'.$page.'.html'; ?>
where $page is the value of ?page= in the URL just to test.
but nothing is being passed through... all i see is "includes/.html"
I would have gone straight into using:
<?php Include("includes/'.$page.'.html"); ?>
EDIT:: Ive have also tried using:
<?php include("includes/$page.html"); ?>
EDIT AGAIN:: Ive tried this and still nothing..
<?php
if ($page='') {
$page = 'home';
Include("includes/$page.html");
} Else {
Include("includes/$page.html");
}
?>
But that hasnt worked either. =/
I get the following message Error:
Quote
[phpBB Debug] PHP Notice: in file /homepages/1/d248187167/htdocs/test.php on line 148: main() [function.include]: Failed opening 'includes/.html' for inclusion (include_path='.:/usr/lib/php')
but evidently its not that simple.. does anyone have a solution that i can work from?
This post has been edited by Saldash: 20 January 2009 - 04:14 AM

New Topic/Question
Reply




MultiQuote






|