1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I add the php code to guestbook footer?

Discussion in 'Co-op Advertising Network' started by zamolxes, Nov 30, 2004.

  1. #1
    I managed to add the code everywere on the site but to the footer of the guestbook (it's the 'advanced guestbook' that comes with most hosting plans)
    Can anyone help?
    The guestbook is installed in a "guestbook" subfolder. I've tried the code with/without the php tags, using the default/full path to the ad_network.php file but... no luck.
     
    zamolxes, Nov 30, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    What's the URL of the guest book?
     
    digitalpoint, Nov 30, 2004 IP
  3. zamolxes

    zamolxes Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    www.musicians-anytime.co.uk/guestbook

    I thought changing from .htm .html server parsed would be tricky but that went without problems. Instead I got stuck with the guestbook!

    I really need to learn php someday! :mad:

    I have recently created a subdomain that should have soon over 1000 pages all php. I guess changing my account setting from the main domain to the subdomain is my only alternative if nothing else works.
     
    zamolxes, Nov 30, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    It's PHP based, so it shouldn't be too hard... probably just a matter of adding the PHP code to the index.php file...

    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0];
    PHP:
    If you've done that already, does it give any errors or anything?
     
    digitalpoint, Nov 30, 2004 IP
  5. zamolxes

    zamolxes Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I tried that before and after the "include("$base_path/footer.php");" without success.
    I've also tried it in header.php and footer.php. Again no luck.
    When I enter it like that (withou the <?, ?>) in index.php or header.php nothing happens.
    When i try the same way in footer.php it just appears on the guestbook pages

    "include ('ad_network.php');
    echo "
     
    zamolxes, Nov 30, 2004 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Hmmm... it's really hard to say without being able to see how it works. But footer.php is probably the best bet. Is there any other PHP code in that file?
     
    digitalpoint, Nov 30, 2004 IP
  7. zamolxes

    zamolxes Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    footer.php is in a "templates" subfolder within the guestbook folder and I don't see any php code there it's just:

     
    zamolxes, Nov 30, 2004 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    Try adding <?php echo 'Testing'; ?> to the footer. If you add that does it output "Testing" in the browser, or leave it as PHP code (you would have to view source to see it then)?
     
    digitalpoint, Nov 30, 2004 IP
  9. zamolxes

    zamolxes Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I can see it as php code using "view page source".
    Nothing in the browser.
     
    zamolxes, Nov 30, 2004 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    Hmmm... ok, then the footer page isn't evaluating any PHP code I guess. Probably needs to go in index.php in that case (somewhere within the existing PHP tags).
     
    digitalpoint, Nov 30, 2004 IP
  11. zamolxes

    zamolxes Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Thanks for your help.

    I managed to do it in the end by adding the code not only to index.php (as that was only showing the adds on the main page) but also to admin.php, comment.php and picture.php

    And now finally the ads seem to finally display on every page!
     
    zamolxes, Nov 30, 2004 IP