#!/usr/bin/perl require ("../cgi-lib.pl") or die "Could not open or find cgi-lib.pl\n"; # declare variables $current_ip = "nothing"; $filename = "links.txt"; # call initial functions &Get_request_types; &Analyse_file; ######################################################################### sub Get_request_types { &ReadParse(*input); $link_cat_in = ($input{'category'}); $name_in = ($input{'name'}); $url_in = ($input{'url'}); $desc_in = ($input{'desc'}); } ######################################################################### sub Analyse_file { print &Header; print &Top("test"); $output = "STDOUT"; open (LINKSFILE, ">>links.txt") || die "Could not open or find $filename\n"; foreach $line () { ($category, $name, $url, $desc, $features) = split('|', $line); if ($name_in eq $name) { print $output "The link $name already exists in the database..
"; } else { print LINKSFILE "$link_cat|$name_in|$url_in|$desc_in"; print $output "Link has been added"; } close LOGFILE; } print &Bottom; } ######################################################################### #_____Module Returns the Output Document Type______# sub Header { return "Content-type: text/html\n\n"; } #_____Module Returns the Output Document Head_______# sub Top { my ($title) = @_; return <<"ENDPRINT"; acheron.org // admin / banner statistics

ENDPRINT } #_____Module Returns the Output Document Bottom______# sub Bottom { return "

\n"; }