Using include() to load different page content acts differently locally vs hosted

Posted by hookedonwinter on Stack Overflow See other posts from Stack Overflow or by hookedonwinter
Published on 2010-05-10T04:03:24Z Indexed on 2010/05/10 4:08 UTC
Read the original article Hit count: 271

I have a live site that includes different php files depending on what page the user is trying to access. The header and footer are the same, but in the file, if the user requests filename1.php vs filename2.php, a different php is loaded into the content of the page. Basic CMS stuff.

On the live site, it works fine. I just set up a local dev environment, and it doesn't work. The file that is supposed to load into the middle of the page instead is the only file loaded. I'm not saying this well. Here's an example:

How it works live:

<html>
    <head>
        Stuff
    </head>

    <body>
        More stuff
        <? include( 'some_file.php' ); ?>
    </body>
</html>

How it works locally:

<? include( 'some_file.php' ); ?>

Just that file loads, no other content.

Any thoughts on why that one page is loading, but not the surrounding content? If I'm not explaining this well, please let me know.

© Stack Overflow or respective owner

Related posts about php

Related posts about development-environment