Php Include help, needed

Discussion in 'PHP' started by oldmeanandcranky, Jan 28, 2008.

  1. #1
    http://www.wildgamehunting101.com/hunting/datas/theindex.php

    Warning: main(datas/leaderboard.php) [function.main]: failed to open stream: No such file or directory in /home/wildgame/public_html/hunting/datas/theindex.php on line 29

    Warning: main(datas/leaderboard.php) [function.main]: failed to open stream: No such file or directory in /home/wildgame/public_html/hunting/datas/theindex.php on line 29

    Warning: main() [function.include]: Failed opening 'datas/leaderboard.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/wildgame/public_html/hunting/datas/theindex.php on line 29

    could someone explain why I am getting these error codes/

    I have my css file and config.php uploaded into the datas folder,

    permissions for both files are 644 which is the default permission,

    just learning PHP and would appreciate some input if possible.
    thanks
     
    oldmeanandcranky, Jan 28, 2008 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    Just looking at the directory locations ,
    just put leaderboard.php in the include if its in the same directory. If its in a subfolder from the calling file, you have to include that directory.
    example: index.php
    include (leaderboard.php)
    if same directory,
    if leaderboard.php is in /datas use
    include (datas/leaderboard.php)
    or
    include (./datas/leaderboard.php)
    Pieces of info needed would be the include line for that file and its location in relation to the file.
     
    shallowink, Jan 28, 2008 IP
  3. oldmeanandcranky

    oldmeanandcranky Guest

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I entered the full url for the leaderboard and now I get this error;

    Fatal error: Call to undefined function: googleads() in /home/wildgame/public_html/hunting/datas/leaderboard.php on line 4

    Is this the file I have to work with to fix ?

    / google_ads.php
    function googleAds($ad_format, $color_border="FFFFFF", $color_bg="FFFFFF", $color_link="D22225", $color_url="000000", $color_text="000000") {
    global $show_google, $adsense_pub, $adsense_channel, $site, $templatefoldername, $sitexml;


    thanks for your help
     
    oldmeanandcranky, Jan 28, 2008 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #4
    Leaderboard.php would have to include the google_ads.php file. Where is it located? In relation to the leaderboard.php file?
     
    shallowink, Jan 28, 2008 IP
  5. oldmeanandcranky

    oldmeanandcranky Guest

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    .wildgamehunting101.com/hunting/datas/google_function.php

    .wildgamehunting101.com/hunting/datas/leaderboard.php

    these are the files--
     
    oldmeanandcranky, Jan 28, 2008 IP
  6. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #6
    Should just have to put include(google_functions.php) in the leaderboard.php. Since they are in the same directory.
     
    shallowink, Jan 28, 2008 IP
  7. oldmeanandcranky

    oldmeanandcranky Guest

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sorry, not sure how i would do that . Could you explain further?
     
    oldmeanandcranky, Jan 28, 2008 IP
  8. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #8
    Just open up leaderboard.php, at the top, inside the php brackets type in
    include("google_functions.php");
    First check to see if its listed already and that its like that.

    Here's tizag's reference on includes:
    http://www.tizag.com/phpT/include.php
     
    shallowink, Jan 28, 2008 IP
  9. oldmeanandcranky

    oldmeanandcranky Guest

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thanks for the tizag link-

    I think I'm going to go back to square one with this project.
    every correction I make, just opens up another error.
    I should be able to just insert the includes ,as is , without making changes.
    This is just a niche-in-a-box site.
    Obviously I have missed something along the way.

    I think maybe I should put this out for a bid or would you be interested to give me a price to set up this page?
    Anyway thanks for all your help
     
    oldmeanandcranky, Jan 28, 2008 IP