#!/usr/bin/perl ###################################################### ## ## ## LinkUp ## ## ## ## User-submittable searchable URL links database ## ## ## ## (c) 2000, Uplink Productions ## ## uplink@uplink.com.au ## ## www.uplink.com.au ## ## ## ## Australian-made software. ## ## ## ## See Readme.txt for installation/setup details. ## ## ## ###################################################### open(INF,"linkup.ini") or &ini; $tb = ; $fc = ; $latest = ; chomp($latest); close(INF); print "Content-type:text/html\n\n"; open(INF,"linkheader.shtml"); @lh = ; close(INF); foreach $lh (@lh) { print $lh } read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } print "
"; print "Search: "; print "   "; print "
"; print "$latest"; foreach $lf (@lf) { print $lf } print "
Link Summary:

"; opening: open(INF,"links.txt") or retry(); flock(INF,2); @links = ; close(INF); foreach $ex22 (@links) { $count2 = $count2 + 1; } open(INF,"linkareas.txt"); @areas = ; close(INF); print ""; foreach $ex1 (@areas) { chomp($ex1); ($name2,$code) = split(/\|/,$ex1); if (substr($name2,0,1) eq "+") { $al = length($name2) - 1; #print "$al"; exit; $name = substr($name2,1,$al); } else { $name = $name2 }; $count = 0; foreach $ex2 (@links) { ($lcode,$email,$url,$title,$date) = split(/\|/,$ex2); if ($lcode eq $code) { $count = $count + 1 } } print ""; } print "
$name
$count


There are $count2 links in the database."; open(INF,"linkfooter.shtml"); @lf = ; close(INF); foreach $lf (@lf) { print $lf } exit; sub dienice { my($errmsg) = @_; print "

Error

\n"; print "$errmsg

\n"; print "\n"; exit; } sub formerror { my($errmsg) = @_; print "

Form Error

\n"; print "$errmsg

\n"; print "Use your browser's back button to go back and correct the mistake.
"; print "\n"; exit; } sub retry { goto("opening") } sub ini { print "Error! Can not open AreaBoard config file!"; exit; }