...

View Full Version : Include Errors



nicky
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"); ?>

Text

<?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

fl00d
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.


include('/home/user_name/public_html/header.php');


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

include('header.php');

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum