Forum Moderators: coopster
Here's a link to the page:
<snip>
My include code is in the content.php file and here it is:
<?php
$found = FALSE;
if(file_exists("$page.html"))
{
include("$page.html");
$found = true;
}
if(!$found)
{
include("error.html");
}
?>
And yes, that is the corrent directory structure for where the events.html file is located.
[edited by: dreamcatcher at 7:06 am (utc) on Aug. 10, 2008]
[edit reason] No personal urls, thanks. [/edit]
I've had that happen several times when PHP or Apache was updated by hosts. I had to change what I had in .htaccess for the file handlers.
In that regard, it isn't automatic that there's an .htaccess file, any more than it's automatic that there be a robots.txt If there's no .htaccess file, open up Notepad and make one yourself, then upload it to the root of your site.
Here you go:
parse html for php [google.com]
>>I'm a newbie to php, but as far as i now $page is the variable to include my other pages when i link them.
But you don't use the variable in an include, you include a file by name (unless you've already assigned a filename to the variable. This is how it's done, it works on every site I do, with .html pages :
<?php include('page.php'); ?>
Actually, when using includes it's better to have a .php file extension, page.php or page.inc.php
[edited by: Marcia at 7:57 am (utc) on Aug. 10, 2008]