Ok, duh, I got this one myself. I copied the code from coop_wrapper.cgi into my cgi templates and it now appears. THIS is my final question: where do I put the formatting (center, font, etc.)? Does it go in coop.php? in the cgi code? the html file? Thanks clickdoc for all your help!
No, I was doing it in my directory. I had some cgi pages that I had trouble with. Once I used the correct coop_wrapper code, and set my permissions correctly, it worked.
THIS is my final question: where do I put the formatting (center, font, etc.)? Does it go in coop.php? in the cgi code? the html file?
you should not use tags like <center> or <font> these days. I would just put a div around the ads and then use CSS to format the text in your page template
freedom2... I now know how you feel... I cannot seem to get this working either. Please someone tell me where I have gone wrong. I am trying to set this up on this page www.online-web-design-course.com/forum/archive/o_t__t_92__flash-resources-tutorials.html If you look at the source you will see I have tried it in 2 ways without success.
To those who might be having problems with this, I suggest trying a subroutine with Clickdoc's code. e.g., sub ShowAds{ #!/usr/bin/perl # $Id: coop_wrapper.cgi,v 1.2 2005/01/07 21:19:02 cvs Exp $ # $Revision: 1.2 $ use strict; use LWP::UserAgent; # set the full http path to the page here: my $ad_url = qq{http://www.DOMAIN.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("Perl-Php-Coop-Wrapper/1.2"); 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 "<br/><div align=center>"; print $output; print "</div>"; } Code (markup): Place this anywhere in your .cgi file (probably at the end), then just call the subroutine in your .cgi file with ShowAds() in the proper location (most likely where the footer should go). For some reason this worked for me. If I placed the code in place of the subroutine, in the exact same location, I got an Internal Server Error; if instead I defined the subroutine and called that, it worked. With the div tag lines in there obviously being optional.
I am using the perl cgi php wrapper. The coop.php works fine and displays the coop ads, but when I call it via SSI includes, it does not show up anything. What do you think the problem is ?
Clickdoc - will this work with the new php code. I noticed that the img tracking file is does not show in the cgi wrapper - most likely the content type needs to be changed for the image file? I haven't test whether or not this affects validation.
The image tracking relies on the HTTP_USER_AGENT and it was not being passed, only the IP. Here is updated code for the wrapper, coop.php and the perl code need to be updated. ### start coop.php <?php $_SERVER['REMOTE_ADDR'] = $_GET['ip']; $_SERVER['HTTP_USER_AGENT'] = $_GET['agent']; include ('ad_network_218.php'); echo $ad_network; ?> ### end coop.php ### start updated perl code sub ShowAds{ #!/usr/bin/perl # $Id: coop_wrapper.cgi,v 1.3 2005/05/02 18:19:02 cvs Exp $ # $Revision: 1.3 $ use strict; use LWP::UserAgent; # set the full http path to the page here: my $ad_url = qq{http://www.DOMAIN.COM/COOP.PHP}; $ad_url .= qq{?ip=} . $ENV{REMOTE_ADDR}; $ad_url .= qq{&agent=} . $ENV{HTTP_USER_AGENT}; my $output = ''; $output .= qq{Content-type: text/html\n\n} if($ENV{GATEWAY_INTERFACE} =~ /CGI/); my $ua = new LWP::UserAgent; $ua->agent("Perl-Php-Coop-Wrapper/1.2"); 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 "<br/><div align=center>"; print $output; print "</div>"; } ### end updated perl code
for those that don't want to update their files completly the only changes that need to be made are to: add: $ad_url .= qq{&agent=} . $ENV{HTTP_USER_AGENT}; to your perl code right after this line: $ad_url .= qq{?ip=} . $ENV{REMOTE_ADDR}; and then add: $_SERVER['HTTP_USER_AGENT'] = $_GET['agent']; to the top of your coop.php
Would anybody be interested in setting up the cgi version on a site for me ? I can't get it to work and need to get coop on to this site. I'll offer $100 to you cgi gurus to implement the code on my site. The site url is storesatellite.com . I have been trying to get this going for some months now and have almost no hair left Thanks for any help