View Full Version : Include Errors

08-05-2008, 03:02 AM
I'm having some trouble with my PHP includes. At the top and bottom of my website pages, I'm including this code...

<?php include("http://www.candi-coded.com/header.php"); ?>


<?php include("http://www.candi-coded.com/footer.php"); ?>

However, when I view the pages online it says...

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/w/o/a/woahxpinkxo/html/testing.php on line 1

Warning: include(http://www.candi-coded.com/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/w/o/a/woahxpinkxo/html/testing.php on line 1

Warning: include() [function.include]: Failed opening 'http://www.candi-coded.com/header.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/w/o/a/woahxpinkxo/html/testing.php on line 1

08-05-2008, 04:19 AM
Use the absolute path. I'm pretty sure you can't use domain.com/file.php for inclusions. I've never tried it mind you but the error you're getting seems to indicate you can't.


You can also use uhhh... forget the name of it... local file something? Anyway it looks like this


However, the file including header.php has to be in the same directory.

08-05-2008, 04:56 AM
Yay! The absolute path works! :-P