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 showing but failing validation

Discussion in 'Co-op Advertising Network' started by a389951l, Jan 7, 2005.

  1. #1
    a389951l, Jan 7, 2005 IP
  2. bloodwrath

    bloodwrath Active Member

    Messages:
    1,364
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    90
    #2
    This has happned to me as well
    i usually just hit the

    Validate/Calculate Weight Now a few times then i works

    but i dont see any ads on your site??
     
    bloodwrath, Jan 7, 2005 IP
  3. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Hmmm... I just checked that page and my ads are at the bottom of the page. I'll try to revalidate again.
     
    a389951l, Jan 7, 2005 IP
  4. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #4
    I just tried revalidating twice now and it still fails. There must be something that I am missing.

    Here is the ad_network_ads.txt file:

    1105125894|216.9.35.51|us82jsdd|400|900|4<ad_break><a href="http://www.top-real-estate-agents.org" />Weichert Realtors</a><ad_break><a href="http://www.msn-emotions.net" />MSN Emotions</a><ad_break>

    more ads after that of course
     
    a389951l, Jan 7, 2005 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    You would need to switch to PHP instead of PERL to get support from me (I don't know anything about the PERL version).
     
    digitalpoint, Jan 7, 2005 IP
  6. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Okay fair enough. Could you explain a bit about the wrapper idea that you mentioned in a post (php wrapper to pass the results to the perl script)? I will probably put it out for bid for someone to contstruct it for me and share it with the community. But since I am not a programmer, I just needs some details on how it would work. Thanks.
     
    a389951l, Jan 7, 2005 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Basically was just thinking about having a PHP page that output the ad with the ad_network.php file. Then have a PERL function that just reads that web page and outputs the results. Then you don't have to update the PERL stuff ever.
     
    digitalpoint, Jan 7, 2005 IP
  8. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Shawn,

    Here is the wrapper. I thought I duplicated the behavior of your php script, I did not see any extra information from your script put in the page for validation, there must have been something subtle that I missed. This wrapper of course still requires at least one server to support php, but essentially you only need one and then this wrapper can run on any number of servers. This is also nice for people who have many sites running the coop cause then when you update the php file they only need to update it in one spot. HOWEVER: If anyone out there plans to use it that way be aware that this will hit that php page for EVERY page load, the caching mechanism only applies to queries to the DP servers. So make sure the server running the php script can handle the load.


    #!/usr/bin/perl

    # $Id: coop_wrapper.cgi,v 1.0 2005/01/07 14:22:07 cvs Exp $
    # $Revision: 1.0 $

    use strict;
    use LWP::UserAgent;

    # create a php page that contains the following lines (no # of course):
    # name the page coop.php or something
    # <?php
    # ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    # include ('/path/to/ad_network.php');
    # echo $ad_network[0];
    # ?>

    # then set the full http path to that page here:
    my $ad_url = qq{http://www.yourserver.com/coop.php};

    my $output = '';

    $output .= qq{Content-type: text/html\n\n} if($ENV{GATEWAY_INTERFACE} =~ /CGI/);

    my $ua = new LWP::UserAgent;
    $ua->agent("");
    my $req = HTTP::Request->new(GET => $ad_url);
    my $res = $ua->request($req);
    if($res->is_success) {
    $output .= $res->content;
    }

    # uncomment this line if you are seeing Content-type: text/html in your page
    # $output =~ s/Content-type: text\/html//;

    print $output;
     
    clickdoc, Jan 7, 2005 IP
  9. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    out for bid eh? buy me a beer?
     
    clickdoc, Jan 7, 2005 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
    It won't (quite) work with just that...

    Change the ad URL to also include the end-user's IP address as a 'ip' variable, and use it with this, and it should then work...

    Here's a sample coop.php file:
    <?php
    	$_SERVER['REMOTE_ADDR'] = $_REQUEST['ip'];
    	include ('ad_network.php');
    	echo $ad_network[0];
    ?>
    PHP:
    That should then properly isolate the ad_network.php file.
     
    digitalpoint, Jan 7, 2005 IP
  11. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    one request shawn. can you start putting some sort of version number at the top of the php file so i can tell quickly if my sites have the latest version? i have it installed in a few places and i lose track of which ones have been updated.
     
    clickdoc, Jan 7, 2005 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    Yeah... was already planning on doing that.
     
    digitalpoint, Jan 7, 2005 IP
  13. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #13
    cool.

    will that coop.php file you posted work as is? without the ini_set line? im about to update all my sites to use this wrapper.
     
    clickdoc, Jan 7, 2005 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    Yeah it should. Be sure to change the URL in the PERL site to include the IP address of the end user though.
     
    digitalpoint, Jan 7, 2005 IP
  15. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #15
    yes i see how the validation is working now. i totally glossesd over that late last night when i was updating the perl. here is the updated wrapper that passes the ip address of the remote host so that it will include the class= when your server is the one requesting the page.

    #!/usr/bin/perl

    # $Id: coop_wrapper.cgi,v 1.0 2005/01/07 14:22:07 cvs Exp $
    # $Revision: 1.0 $

    use strict;
    use LWP::UserAgent;

    # create a php page that contains the following lines (no # of course):
    # name the page coop.php or something
    #<?php
    # $_SERVER['REMOTE_ADDR'] = $_REQUEST['ip'];
    # include ('ad_network.php');
    # echo $ad_network[0];
    #?>

    # then set the full http path to that page here:
    my $ad_url = qq{http://www.yourserver.com/coop.php};

    $ad_url .= qq{?ip=} . $ENV{REMOTE_ADDR};

    my $output = '';

    $output .= qq{Content-type: text/html\n\n} if($ENV{GATEWAY_INTERFACE} =~ /CGI/);

    my $ua = new LWP::UserAgent;
    $ua->agent("");
    my $req = HTTP::Request->new(GET => $ad_url);
    my $res = $ua->request($req);
    if($res->is_success) {
    $output .= $res->content;
    }

    # uncomment this line if you are seeing Content-type: text/html in your page
    # $output =~ s/Content-type: text\/html//;

    print $output;
     
    clickdoc, Jan 7, 2005 IP
  16. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #16
    Beer, shot, case - whatever you want clickdoc - you are the man. Let me know when you are in the Boston area :).

    Thanks Shawn for helping out also!
     
    a389951l, Jan 7, 2005 IP
  17. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #17
    lol. you mean like right now? sittin about .5 miles from Fenway park on the other side of the back bay fens.
     
    clickdoc, Jan 7, 2005 IP
  18. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #18
    Really? I'll pm you tonight after work and see what we can do about the beer sometime in the next few weeks - blueberry beer - I haven't had that in awhile at Boston Beerworks but I digress.
     
    a389951l, Jan 7, 2005 IP
  19. Nick0r

    Nick0r Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    wow great work, it worked perfectly!!!
     
    Nick0r, Jan 7, 2005 IP
  20. clickdoc

    clickdoc Guest

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #20
    yes the blueberry beer there is very good.

    there is one small change. the code for the coop.php should be

    <?php
    $_SERVER['REMOTE_ADDR'] = $_REQUEST['ip'];
    include ('ad_network.php');
    echo $ad_network[0];
    ?>

    the one shawn posed had two == when trying to set the REMOTE_ADDR so the class= tags were getting put in every time.

    i will edit the above code as well just to avoid confusion.
     
    clickdoc, Jan 7, 2005 IP