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.

Ads not working in directories

Discussion in 'Co-op Advertising Network' started by piniyini, Nov 13, 2004.

  1. #1
    So I added the Co-op ads to my blog which is powered by blogger and found out that the ads only work in the main directory

    In the other dirs I get an error, does anyone know how to make them work?

    Main page = www.toseef.com

    Dir = http://www.toseef.com/2004/08/t-mobile-dont-allow-access-to-y-email.html
     
    piniyini, Nov 13, 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
    You could try using the full file path to ad_network.php in your include statement.
     
    digitalpoint, Nov 13, 2004 IP
  3. piniyini

    piniyini Well-Known Member

    Messages:
    514
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    170
    #3
    Thought I'd post the solution here for anyone who has a similar problem in the future.

    <?php $dir_dots = substr_count($_SERVER["PHP_SELF"], "/"); if ( $dir_dots == 1 ) { $dir_path = "./ad_network.php"; } else { $dir_path = "../../ad_network.php"; } include($dir_path); ?>
    PHP:
    The above code is simple stuff and works fine on blogger based websites
     
    piniyini, Nov 14, 2004 IP