Coop ads on "Free PHP Directory Script" pages

Discussion in 'Co-op Advertising Network' started by dakar, Dec 20, 2004.

  1. #1
    Okay I give up, I've added the "Free PHP Directory Script" to start a mini directory targeted at my audience, however for two days now I can't seem to get the coop adds to display on the pages, I've tried everything I can think of, the whole Directory is written in PHP and just inserting the code doesn't do it, I've tried the method for HTMl pages using the .htaccess file, again no joy.

    Anyone been able to sucessfully get them to work with this package? The only link to it is from a DHTML menu that SE's shouldn't follow, but I'd like to get the ads working and start getting the Directory populated a bit and finish the cosmetics and get her ready to be crawled.

    the URL for the Directory is located here.

    BTW anyone with a related site is welcome to submit their site to the directory (commercial sites need not have a recip link just add Digital Point to the description).

    Thanks in advance!
     
    dakar, Dec 20, 2004 IP
  2. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #2
    surround the code with "<? php" and "?>" it looks like it's just echoing the text.
     
    nevetS, Dec 20, 2004 IP
  3. Patient

    Patient Raider

    Messages:
    336
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #3
    Hi dakar

    As you say should be straightforward - the bizarre thing in this case is that the whole page is php yet if you view source the page the php for the ad network is clearly visible and unparsed.

    I don't see any </body></html> - is there anything else on the page that is also failing!
     
    Patient, Dec 20, 2004 IP
  4. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #4
    Just tried the "<? php" and "?>" again, and same results... prints out the ad code :(

    Everything else works perfectly as far as the directory is concerned... I'll admit it's written a bit unconventional from everything else I've seen, but it's quick and lightweight and works well.
     
    dakar, Dec 20, 2004 IP
  5. Patient

    Patient Raider

    Messages:
    336
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #5
    If I remember rightly that script is now built from templates with petty much everything on the index page called via a template.

    As I recall it is also 100% php. Does it still have ending.php or footer.php? Have you tried placing the coop code there?
     
    Patient, Dec 20, 2004 IP
  6. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #6
    Patient, you are correct.. it's all 100% php, the each of the footer templates actually built into each php file, no external calls to get a footer template or any other....

    $TEMPLATE["FOOTER"] = <<<EOF
    <br />
    <br />
            Powered by <A HREF="http://www.biz-directory.org/directory_script.php">Free PHP Directory Script</A> &copy; <A HREF="http://www.biz-directory.org/">Biz Directory</A>
    <br /><br />
    
    "<? php"
            ini_set ("include_path", ini_get ("include_path") . 
    ':../:../../:../../../:../../../../');
            include ('ad_network.php');
            echo $ad_network[0];
            echo $ad_network[1];
            echo $ad_network[2];
            echo $ad_network[3];
            echo $ad_network[4];
    "?>"
    
    ?>
    
    Code (markup):
    I ommited the other stuff I'd added into it.
     
    dakar, Dec 20, 2004 IP
  7. Patient

    Patient Raider

    Messages:
    336
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #7
    Try removing the php tags from the ad code i.e. try just:

    ini_set ("include_path", ini_get ("include_path") .
    ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0];
    echo $ad_network[1];
    echo $ad_network[2];
    echo $ad_network[3];
    echo $ad_network[4];
     
    Patient, Dec 20, 2004 IP
  8. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #8
    Tried that again for grins.... Same results :( just displays the ad code in the page as text... it's like it will not recognize it as code to be parsed...

    BTW not that it really matters, nothing in the error_log either....
     
    dakar, Dec 20, 2004 IP
  9. Patient

    Patient Raider

    Messages:
    336
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #9
    The code in your post has quotation marks:

    "<?php"
    "?>"

    Are they actually present? If so try removing them!
     
    Patient, Dec 20, 2004 IP
  10. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #10
    Tried it by removing the quotes around the <? ?>, and removing the <? ?>tags around the ad code all together as well (thats how the page is now), still no joy. This is getting frustrating. Must be overlooking something really simple here somewhere, I just can't figure out why it wont parse it.

    BTW your username really fits well... thanks for the assist on this one!
     
    dakar, Dec 20, 2004 IP
  11. Patient

    Patient Raider

    Messages:
    336
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #11
    No problem, happy to help.

    You are right - this is something obvious and simple.

    Why not try adding the code at the very beginning of your index.php file i.e. so that it is the first thing the page processes. If that doesn't work try placing <? echo 'hello<br>'; ?> in the same position just for a laugh!
     
    Patient, Dec 20, 2004 IP
  12. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #12
    BINGO! I got it working! Added it to the end of the index.php instead of the tempalte_index.php and it now works just fine.... Odd that the footer wouldn't parse it, but I'm still just a PHP hacker, never claimed to understand all of this stuff yet.

    Thanks again! Perhaps in the future this little battle will help someone else from pounding their head on a desk for hours.
     
    dakar, Dec 20, 2004 IP