Subject: Re: [linux-audio-dev] OT: How to do random adverts?
From: CK (x_AT_meta.lo-res.org)
Date: Fri Nov 16 2001 - 14:22:24 EET
I read:
>
> In the interest of promoting Linux Audio Development, can anyone point
> me to a good place to find out how to set up a system that loads adverts
> randomly when a webpage is accessed?
hmmm ... now I wonder what these things have to do to with each other ??
anyway since I guess using an ad frame is no problem in this line of
work how about having this.cgi as the top frame src :
#!/usr/bin/perl
if (open(FILE, "list.txt"))
{
@urls = <FILE>;
close(FILE);
}
else
{
@urls = ('http://lo-ser.org/some.html');
}
rand(time() ^ ($$ + ($$ << 15))); # you get that, right ??
print "Location: ", $urls[rand @urls],"\n\n";
using "content type" and sticking to an image type should make it fairly
easy to adapt this to a script suitable for use in an image tag.
or (to avoid frames) use
print "Content-type: text/html\nPragma: no-cache\n\n";
print "<img src=$urls[rand @urls]>"
print $restofpage
hope that helps,
x
-- chris_AT_lo-res.org Postmodernism is german romanticism with better http://pilot.fm/ special effects. (Jeff Keuss / via ctheory.com)
This archive was generated by hypermail 2b28 : Fri Nov 16 2001 - 14:16:16 EET