Major_Que Posted November 11, 2014 Share Posted November 11, 2014 (edited) 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 . . . Edited November 11, 2014 by Major_Que Quote Link to comment https://forums.phpfreaks.com/topic/292416-help-with-include-statement-cant-get-mine-to-work/ Share on other sites More sharing options...
tryingtolearn Posted November 11, 2014 Share Posted November 11, 2014 Your include is working fine, the problem is with your html and css code. I would start with using the html validator at http://validator.w3.org/ That should get you going in the right direction anyway.. Quote Link to comment https://forums.phpfreaks.com/topic/292416-help-with-include-statement-cant-get-mine-to-work/#findComment-1496363 Share on other sites More sharing options...
Ch0cu3r Posted November 12, 2014 Share Posted November 12, 2014 (edited) 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. Edited November 12, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/292416-help-with-include-statement-cant-get-mine-to-work/#findComment-1496418 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.