Sometimes the includes load, sometimes they don't

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Sometimes the includes load, sometimes they don't

Post by rhecker »

My page design uses a number of PHP includes, for instance, here's the code that loads the menu:

<div id="menubox">
<?php include("php_includes/menu.php"); ?>
</div>

usually the pages load fine, but once in a while it will return an error stating that "....menu.php can't be found." If the refresh button is pressed, the page will probably load correctly. I'm guessing this happens because the browser hasn't caught up, or the server is overly busy, but I need this to not happen! Any thoughts?
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Re: Sometimes the includes load, sometimes they don't

Post by rhecker »

I changed my method. I converted most of the includes to functions, then load the function library at the top. So far this seems to be working. I actually like this method better anyway as it gives me one file to manage all the various includes.
Post Reply