Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 11-11-2014, 05:22 PM
Major Que's Avatar
Major Que Major Que is offline
Junior Member
Join Date: 10-25-14
Location: SW PA
Posts: 14
iTrader: 0 / 0%
PHP Moron Needs Some Help With Simple 'Include' Statement

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 pickmysmoker dot com

My code for article 'include' is:
PHP Code:
<div id="sidebar" class="link-box">
<h3>Popular Articles</h3>
<?php include("articles.php"); ?>
<br />
Thanks in advance . . .
Reply With Quote



Old 11-12-2014, 12:47 PM
kiethhoyt kiethhoyt is offline
Junior Member
Join Date: 09-24-14
Posts: 47
iTrader: 0 / 0%
Remove the () and "".

PHP Code:
<div id="sidebar" class="link-box"> 
<h3>Popular Articles</h3> 
<?php include 'articles.php'?> 
<br /> 
Reply With Quote
Old 11-12-2014, 02:54 PM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,016
iTrader: 4 / 100%
We both might be right but I disagree. I use that exact syntax and my includes load just fine.

@ Major: Is the file you are trying to include in the same directory/folder as the file calling for it?
What error message if any are you getting?
Have you checked your spelling? Articles and articles are not the same file.
Does the page name where you are using this include end in .php?
Reply With Quote
Old 11-14-2014, 02:16 AM
ouaibmastaire's Avatar
ouaibmastaire ouaibmastaire is offline
Contributing Member
Join Date: 12-11-13
Posts: 52
iTrader: 0 / 0%
I just checked you site and could see the menu AND article ...
Reply With Quote
Old 11-16-2014, 12:08 AM
AMJAlienServers's Avatar
AMJAlienServers AMJAlienServers is offline
Contributing Member
Join Date: 11-15-14
Location: Madrid
Posts: 65
iTrader: 0 / 0%
Can you use require instead of the include? That should stop the execution and provide you with an error.
PHP Code:
<div id="sidebar" class="link-box">  
<h3>Popular Articles</h3>  
<?php require 'articles.php'?>  
<br />  
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Are you a Moron? webcosmo Forum Lobby 2 08-07-2008 08:06 AM
PHP: simple if browser statement please eviljoker7075 Coding Forum 7 09-25-2006 12:14 PM
need a simple php include Julie Coding Forum 3 09-24-2006 11:16 AM
Maybe I am a moron but.... Stitchy626 Graphic Design Forum 4 07-22-2005 12:42 PM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 02:34 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC