#!/usr/bin/perl ########################################################################### # Link Rountine - link.cgi # # # # Copyright (c) 1999, PathFinder Software # # Normand J. Charette # # # # # # # # Pro-TRACK PRO Version 1.5 09/06/1999 # # # # # ########################################################################### $ResellerID = $ENV{QUERY_STRING}; $ResellerDir = '/home/web7515/website/cgi/protrack/resellers'; if ($ResellerID && &unpackReseller("$ResellerID")) { $imp = $fields[14]; } $AffMatch = "PB"; if ((substr("$ResellerID",-2,2) ne "$AffMatch") && ($ResellerID <= "299")) { print "Content-type: text/html\nLocation:http://www.track2you.com/cgi/spiral/link.cgi?$ResellerID$AffMatch&$imp\n\n"; exit; } #================================================================ sub readFile { open(RESELLER, "$resellFile") || &Error ("Please Wait System Busy! Try again later unable to open and read file $resellFile($!)."); $showReseller = ; chomp($showReseller); close(RESELLER); @fields = split(/\|\|/,$showReseller); } #================================================================= sub unpackReseller { local($ResellerID) = @_; $resellFile = "/home/web7515/website/cgi/protrack/resellers/$ResellerID"; if (-f $resellFile) { &readFile; return 1; } else { return 0; } } #================================================================= sub Error { ($VAR{'ErrorMsg'}) = $_[0]; if (!$VAR{'ErrorMsg'}) { $VAR{'ErrorMsg'} = 'An Unsual System Error Occurred.'; } if (!&ParseTemplate($errorMsgPage, *STDOUT)) { &SetHTML; print $ErrorMSG; } exit; } #================================================================ sub ParseTemplate { local($Template, *OUT) = @_; local($aline, $cline, $changes); &SetHTML; if (!open(TEMPLATE, $Template)) { $ErrorMSG = "Please Wait System Busy! Try again later unable to open Template $Template ($!)."; return(0); } while ($aline =