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

I have a live site that includes different php files depending on which page the user is trying to access. The header and footer are the same, but in the file, if the user asks for filename1.php

vs filename2.php

, a different php is loaded into the page content. Main CMS material.

In real time, the site works fine. I just created a local developer environment and it doesn't work. The file to be loaded in the middle of the page is the only file loaded. I don't say it 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' ); ?>

      

Only this file is loaded, other content.

Any thoughts on why this page is loading but not the surrounding content? If I don't explain it well, please let me know.

Edit:

Could this be the best explanation? or not. Anyway, it's like an included page, instead of loading in the middle of the index file, downloads instead of the index file.

Edit 2:

This is what it looks like live, which can be seen at http://saloncosabella.com/our_team/meet_our_team : live http://img.skitch.com/20100510-j36r58pu6kjrmekexixh81f96i.jpg

And this is what looks like locally: local http://img.skitch.com/20100510-q29f2uq34g5pp68w5ke77dddks.jpg

html that is displayed on the local site (not all that pretty, I know):

                    <a href="/our_team/meet_our_team?stylist=jamie.staton"><img src="/images/our_team/jamie.staton.png" class="thumbnail first_thumb" /></a><a href="/our_team/meet_our_team?stylist=torrey.staton"><img src="/images/our_team/torrey.staton.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=brittany.benallo"><img src="/images/our_team/brittany.benallo.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=victoria."><img src="/images/our_team/victoria..png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=tiahna.cristobal"><img src="/images/our_team/tiahna.cristobal.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=christina.walker"><img src="/images/our_team/christina.walker.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=kristen.pulst"><img src="/images/our_team/kristen.pulst.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=allison.canino"><img src="/images/our_team/allison.canino.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=lia."><img src="/images/our_team/lia..png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=alex.woodworth"><img src="/images/our_team/alex.woodworth.png" class="thumbnail" /></a><a href="/our_team/meet_our_team?stylist=lauren.hassett"><img src="/images/our_team/lauren.hassett.png" class="thumbnail" /></a><a href="?stylist_page=1"><img src="/images/our_team/see_more.png" alt="See More" class="thumbnail" ></a>             <div class="clear"></div> 

      

+2


a source to share


5 answers


Compare the phpinfo () outputs on both servers. See what's different. Perhaps this way you can determine why this is happening.

Alternatively, you can try a third server - perhaps some kind of VM is already configured for LAMPP. See what happens.



Finally, try to make a simple test case, compare the results.

+2


a source


Perhaps the short tag is disabled on your local server. Check this variable,



short_open_tag

      

0


a source


Are your scripts using output buffering? If the header area activates buffering, and your "middle" includes ob_end_clean()

and does not store the returned buffer data, it may look as if only the average is being displayed, even if everything was generated properly.

0


a source


Very very alienating ...

It looks like the webserver is not outputting anything from PHP tags ...

Or maybe the output doesn't run until the PHP module is needed.

¿Can you add text <?php echo "hi"; ?>

to the first line in the local file to check if it works?

0


a source


You have a way out; in your php code? Removing any output, s in my php solved the problem for me.

0


a source







All Articles