Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Include Errors

  1. #1
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post

    Include Errors

    I'm having some trouble with my PHP includes. At the top and bottom of my website pages, I'm including this code...

    PHP 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

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    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.
    PHP Code:
    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
    PHP Code:
    include('header.php'); 
    However, the file including header.php has to be in the same directory.

  • #3
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post
    Yay! The absolute path works! :-P


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •