September 4, 200917 yr Hey all, this one is perplexing me a bit, I'm building a site at Elite Business Services.co.uk. I've used includes, for the navigation and a few other things, but every now and then, instead of including the footer i get a Restricted Access notice in the bottom of the page. Since they're just mark-up and nothing too complex they're not cloaked just in /includes folder. sometimes when I refresh the footer magically appears. Weird Oddly it seems to work sometimes and not others. heres the mark up: the page: <? include "includes/footer.php" ; ?> the include: <div id="maincontentfooter"> <div id="maincontentfooterleft"></div> </div> <div id="maincontentfooterright"></div> <div id="footer"> <img style="float:left;margin-left:10px;" src="images/logos/AccessGoldLogoGraphic.jpg" width="120" alt="Access Gold Partners" /> <? if ($linkstate !="Access") { echo '<img style="float:right;" src="../images/logos/SageBPlogo.jpg" alt="Sage Business Partners" />' ; } ?> <p class="footerlegend">Bringing People and Technology Together</p> <div id="footercontent"> <p class="footer"><? echo $address_inline ; ?> registered in England 3238483</p> <p class="footer">Site Map: <a class="gen" href="index.php">Home</a> | <a class="gen" href="about.php"> About</a>| <a class="gen" href="casestudies.php">Case Studies</a> | <a class="gen" href="news.php"> News </a>| <a class="gen" href="whitepapers.php"> White Papers</a> | <a class="gen" href="contact.php"> Contact</a></p> <p class="footer">Tel: 0800 731 3490 Email: <a class="footerlink" href="mailto:info@elitebusinessservices.co.uk" >info@elitebusinessservices.co.uk</a></p> </div> </div> <div class="clear"></div><!--fix for FF float clearing bug --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-1761079-1"; urchinTracker(); </script> maybe its the google analytics tracker? PS this is my first job as a web designer so any advice regarding the site would be welcome, except for rip it up and burn it, since i dont have time
September 4, 200917 yr Require does basically the same thing, but generates a fatal error if something is wrong. Include tries to fudge through with a warning. Don't forget that you can turn on visible error reporting while you're testing. Placing error_reporting(E_ALL); below an opening php tag will print errors. Your example shows a shorthand opening tag and no brackets, so fix that first if that's what you've been using. I'm not aware of any issues with includes that come from the Apache configuration, but you can always ask your host if this issue continues and you have ruled out mistakes. In a similar way, I have to manage one server that occasionally fails to display images before a refresh fixes it, so these weird things sometimes happen.
September 7, 200917 yr Author This took a strange turn so have re-posted the new problem here: WDForum
Create an account or sign in to comment