php include in footer? HELP

Discussion in 'PHP' started by ЄxDeus™, Jul 14, 2008.

Thread Status:
Not open for further replies.
  1. #1
    i want to add footers to all my sites and control them via 1 file so i made a folder called footers and added it to my website i then placed a php file in it called links.php so i had http://website.com/footers/links.php

    then on my other sites i added this code

    <?php include ("http://website.com/footers/links.php"); ?>
    Code (markup):
    but they dont load the footers it just gives me Warning: include() [function.include]: URL file-access is disabled in the server configuration and other warnings how do i fix that?
     
    ЄxDeus™, Jul 14, 2008 IP
  2. elusid

    elusid Peon

    Messages:
    890
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this instead...

    <?php include "http://website.com/footers/links.php"; ?>
     
    elusid, Jul 14, 2008 IP
  3. ЄxDeus™

    ЄxDeus™ Well-Known Member

    Messages:
    2,860
    Likes Received:
    214
    Best Answers:
    1
    Trophy Points:
    155
    #3
    that didnt work.

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/hoky/public_html/inc/footer.php on line 4
    
    Warning: include(http://website.com/footers/links.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/hoky/public_html/inc/footer.php on line 4
    
    Warning: include() [function.include]: Failed opening 'http://website.com/footers/links.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hoky/public_html/inc/footer.php on line 4
    Code (markup):
     
    ЄxDeus™, Jul 14, 2008 IP
  4. elusid

    elusid Peon

    Messages:
    890
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It looks like your host has remote file includes disabled most likely for security. I would send them a ticket.
     
    elusid, Jul 14, 2008 IP
  5. elusid

    elusid Peon

    Messages:
    890
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    or you could try doing this as a work around..

    <?
    $a = file_get_contents("http://www.somedomain.com/file.php");
    echo ($a);
    ?>
     
    elusid, Jul 14, 2008 IP
    ЄxDeus™ likes this.
  6. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #6
    In your footer.php, what does it says on line 4?
     
    proxywhereabouts, Jul 14, 2008 IP
    ЄxDeus™ likes this.
  7. 2slick

    2slick Peon

    Messages:
    73
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    if it is in the same server, use reference
    
    <?php include ("footers/links.php"); ?>
    
    Code (markup):
    on an external server
    
    $footer=file_get_contents("http://website.com/footers/links.php";
    
    echo $footer; 
    
    
    Code (markup):
     
    2slick, Jul 14, 2008 IP
    ЄxDeus™ likes this.
  8. ЄxDeus™

    ЄxDeus™ Well-Known Member

    Messages:
    2,860
    Likes Received:
    214
    Best Answers:
    1
    Trophy Points:
    155
    #8
    that one worked thank you :)

    +rep to you all.
     
    ЄxDeus™, Jul 14, 2008 IP
Thread Status:
Not open for further replies.