#!/usr/local/bin/perl ################################################################################ # helplink.cgi # Redirect user to related HELP page based on keyword search of current URL # Author: Jeff McAdoo # Please contact Jeff McAdoo or Ray Semiraglio for info # 04/16/01 ################################################################################ use CGI; # Link to pipe delimited database; 2 fields $data = "helplink.dat"; # Define variables; create objects $query = CGI::new(); # Get referring URL $oldURL = $query->referer(); #Compare string(oldURL) to field 1(keyword) of database; match and return field 2(URL) open(file, "<$data"); while(){ ($keyword, $url)=split(/\|/, $_); $match = index($oldURL, $keyword); if ($match!=-1){ print "Location: $url\n\n"; last; } } close(file); print "Location: http://www.sportsline.com/help\n\n"; exit;