View Single Post
Old 05-04-2005, 07:03:10 PM     #5 (permalink)
apd

 
Join Date: Mar 2005
Posts: 713
apd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond reputeapd has a reputation beyond repute

If you can use perl then hopefully this will do what you want:

-------------------------------------------------------------------------
#!/usr/bin/perl -wT

use strict;

my $url = $ENV{'HTTP_REFERER'};
my $main_page = "index.cgi";

open (DOMAINS_DB, "< domains.db");
my @JUMP = <DOMAINS_DB>;

# Loop through database file
foreach my $row (@JUMP) {
chomp($row);
my ($domain, $page) = split(/\|/, $row);

if ($domain eq $url) {
# If found jump to new landing page
print "Location: $page\n\n";
}
}

close (DOMAINS_DB);

exit(0);
-------------------------------------------------------------------------

Example of domains.db file


www.domain1.co.uk|loans.html
www.domain2.com|people.cgi
www.domain3.co.uk|money.php
etc
etc
apd is offline