Jump to content

Help With 'include' statement - Can't Get Mine To Work


Major_Que

Recommended Posts

I am incorporating a very basic 'include' statement on a new site. One 'include' calls up menu.php and the second calls up article.php. Both of these files are located in the same file folder as all the pages for this site.

 

On the index.php page, everything works as expected and both files are showing like they are suppose to. However, the article.php file is not showing up on subsequent pages while the menu.php seems to work fine.

 

Now I am a complete moron when it comes to php so I have no clue what the problem is or how to fix it so I would really appreciate any help I can get to fix this.

 

The site is at http://pickmysmoker.com

 

My code for article 'include' is:

<div id="sidebar" class="link-box">
<h3>Popular Articles</h3>
<?php include("articles.php"); ?>
<br />
</div>
 
 
Thanks in advance . . .

I Agree with tryingtolearn. The include statements are working fine as you can see the html output of  articles.php in the (HTML) source code for all your pages (right click > view source).

 

There is most likely an issue with your HTML or CSS for why the the sidebar div does not show on the other pages.

 

 

EDIT. I think I have found the course. In your other pages you have different negative margins applied to the #sidebar selector. Removing the negative margins and the sider appears fine on all the other pages.

 

You may find it easier to use floats instead playing about with margins.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.