Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wierd Restricted Access Problem, using PHP includes

Featured Replies

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 :fool:

 

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 ;)

Try,

require("includes/footer.php");

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.

  • Author

cheers guys i'll give em a try and let you know my progress

 

:)

  • Author

This took a strange turn so have re-posted the new problem here:

 

WDForum

:blink:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.