Php help needed - Easy $2 - 1 minute job

Discussion in 'Programming' started by simon369, Sep 23, 2007.

  1. #1
    Im setting up a proxy network and have a template. It uses a config.php file to contain the variables e.g. adsense code etc

    I want something like that but where it gets other details from a external file located on simon369.info

    I want the footer text to load from simon369.info/footer.php so i can change all the sites footers with only editing one file

    This cant interupt with the /config.php thing already on

    If you can post here saying what code to put where i want the footer to go and if there is anything i need to place in the footer.php then i will pay you $2 for the first person to do this

    Thanks
     
    simon369, Sep 23, 2007 IP
  2. nts

    nts Active Member

    Messages:
    220
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    This will display the contents of footer.php:

    <?php
    echo @file_get_contents("http://simon369.info/footer.php");
    ?>
    Code (markup):
     
    nts, Sep 23, 2007 IP
  3. simon369

    simon369 Active Member

    Messages:
    1,712
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 4
    As Buyer:
    100% - 0
    #3
    IT didnt work

    This is what i had, So i wanted it to say copyright 2007 then the site title (that works) then load the contents of the file.

    <div id="footer">&copy 2007 <?php echo($title); ?> - <?php
    echo @file_get_contents("http://simon369.info/footer.php");
    ?></div>
    
    Code (markup):
    It doesnt load the contents

    Thanks
     
    simon369, Sep 23, 2007 IP
  4. nts

    nts Active Member

    Messages:
    220
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    You could be getting an error. Remove the @ symbol, and see if it returns any errors or warnings.
     
    nts, Sep 23, 2007 IP
  5. simon369

    simon369 Active Member

    Messages:
    1,712
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 4
    As Buyer:
    100% - 0
    #5
    Nope still didnt do anything

    Thanks
     
    simon369, Sep 23, 2007 IP
  6. bemaniso

    bemaniso Peon

    Messages:
    98
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    does
    $content=file_get_contents("http://simon369.info/footer.php",FALSE,NULL,0);
    echo $content;
    PHP:
    work?
     
    bemaniso, Sep 23, 2007 IP
  7. nts

    nts Active Member

    Messages:
    220
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    If you have PHP4, this should work, if the above does not:

    include("http://simon369.info/footer.php");
    Code (markup):
     
    nts, Sep 23, 2007 IP
  8. simon369

    simon369 Active Member

    Messages:
    1,712
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 4
    As Buyer:
    100% - 0
    #8
    Nope that didnt work either im affraid

    I have to go bed now anyway cos its late

    Will be back tomorrow
     
    simon369, Sep 23, 2007 IP
  9. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #9
    I suggest you check you are doing it correctly, as:
    echo file_get_contents("http://www.simon369.info/footer.php");
    PHP:
    will work...
     
    papa_face, Sep 23, 2007 IP
  10. jWebXpress

    jWebXpress Well-Known Member

    Messages:
    646
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    As Seller:
    100% - 1
    As Buyer:
    100% - 1
    #10
    Try This One

    <?include("footer.php");?>
    PHP:
     
    jWebXpress, Sep 23, 2007 IP
  11. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #11
    Check if allow_url_fopen is on, also try:

    error_reporting(E_ALL);
    ini_set('display_errors', true);
    echo (file_get_contents('http://simon369.info/footer.php')) ? 1 : 0;
    PHP:
     
    krt, Sep 23, 2007 IP
  12. NoobieDoobieDo

    NoobieDoobieDo Peon

    Messages:
    1,456
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #12
    Use Curl if fopen isn't allowed.
     
    NoobieDoobieDo, Sep 23, 2007 IP
  13. simon369

    simon369 Active Member

    Messages:
    1,712
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 4
    As Buyer:
    100% - 0
    #13
    non of the above work and when i try what krt says this is what i get

    Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/simoninf/public_html/index.inc.php on line 100
    
    Warning: file_get_contents(http://simon369.info/footer.php) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/simoninf/public_html/index.inc.php on line 100
    0
    Code (markup):
    What does that mean

    Thansk
     
    simon369, Sep 23, 2007 IP
  14. wormy

    wormy Active Member

    Messages:
    1,112
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #14
    I think this means you need to go to your php.ini and change "allow_url_include = Off" to "allow_url_include = On"
     
    wormy, Sep 23, 2007 IP