#!/usr/local/bin/perl
#//////////////////////
#傾僪僎僢僠儏 v1.0
#惢嶌挊嶌 僶僇僐儞僪僢僩僐儉
#惢嶌擔
#//////////////////////
#仭弶婜愝掕--
$data_dir ="./data/ad.txt"; #奿擺愭
$jump_url ="http://www.moco-coco.com/96849/"; #奿擺屻丄僕儍儞僾倀俼俴
#仭偙偙傑偱--
#娐嫬曄悢張棟
if($ENV{'QUERY_STRING'}){
$address = $ENV{'QUERY_STRING'};
#僨乕僞奿擺張棟
open(IN,">>". "$data_dir") || die "cannot open $template $!";
print IN $address . "\n";
close(IN);
}
#巜掕URL昞帵張棟
$Query{url} = "$jump_url";
if(!$Query{url}){ &error('晄惓側屇傃弌偟偱偡'); exit;}
print "Location: $Query{url}\n\n";
#僨僶僢僋
sub error{
$message = $_[0];
print 'Content-type: text/html'."\n\n";
print '<HTML><HEAD><TITLE>Request Error</TITLE></HEAD>'."\n";
print '<BODY>'."\n";
print '<H1>'.$message.'</H1>'."\n";
print '</BODY></HTML>'."\n";
}