#!/usr/local/bin/perl # # linkage.cgi # Get Args $buffer = $ENV{'QUERY_STRING'}; $buffer =~ tr/+/ /; $buffer =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("C", hex($1))/eg; foreach (split(/&/, $buffer)) { if ((split(/=/, $_))[0] eq 'lk') { $linkto = (split(/=/, $_))[1]; } } # Open the linkage file open LNK, "../data/linkage.txt" or die "failed"; while () { if ((split(/=/, $_))[0] eq $linkto) { $linkurl = (split(/=/, $_))[1]; last; } } close LNK; $linkurl =~ s/\r//; $linkurl =~ s/\n//; if ($linkurl eq '') { &NoLinkage(); exit; } print "Location: $linkurl", "\n\n"; exit; sub NoLinkage { print "Content-type: text/html","\n\n"; print <<"EOL"; JFTD - リンク
準備中です。お待ちください。
戻る


ホーム

Copyright(c) 2002. All Rights Reserved.
Produced by 花キューピット
EOL }