Help - Search - Members - Calendar
Full Version: Php Can't Include?
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
someone753951
Hi,

I'm new here. I recently uploaded my site. I use the include functions to include the text (content) and menu on my site. But when I go to my site, it doesn't show the things that I normally include. My site is someone753951.zzl.org. It's like PHP isn't even enabled. I hope someone can help me out.

PS: This is the code I use:
to include the menu:
CODE
<?php include("menu.html"); ?>

to include the content:
CODE
<?php
$pages = array("home", "about", "downloads", "trusted", "contact", "upload");

if (isset($_GET['page']) && !empty($_GET['page']))
{
    if(in_array($_GET['page'], $pages) && file_exists($_GET['page'].".html"))
    {
        include($_GET['page'].".html");
    }
    else
    {
        include("404.html");
    }
}
else
{
    include("home.html");
}
?>
Trippin7464
Make sure your pages end with .php
php code will NOT work inside of pages with .html extension.
If thats not the case, please reply.
someone753951
Ah, thanks.. They were .html... At my webserver they did work.. But i'll change it. Thanks
Trippin7464
Yea, I don't know what web server you were using but sometimes they can allow things like that but it's always better to learn and do things the right way.

I'm just glad to see you use <?php and not <? for your tags.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.