home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / www / mirrors / acheron / cgi-bin / links / show_Links.cgi < prev   
Text File  |  1999-02-04  |  2KB  |  78 lines

  1. #!/usr/bin/perl
  2.  
  3. require ("cgi-lib.pl") or die "Could not open or find cgi-lib.pl\n";
  4.  
  5. # declare variables
  6. $current_ip = "nothing";
  7.  
  8. $filename = "links.txt";
  9.  
  10. # call initial functions
  11. &Get_request_types;
  12. &Analyse_file;
  13.  
  14. #########################################################################
  15.  
  16. sub Get_request_types {
  17.         
  18. &ReadParse(*input);
  19. $link_cat = ($input{'Category'});
  20.  
  21. }
  22.  
  23. #########################################################################
  24.  
  25. sub Analyse_file {
  26.  
  27. print &Header;
  28. print &Top("test");
  29. $output = "STDOUT";
  30.  
  31. open (LINKSFILE, "<$filename") || die "Could not open or find $filename\n";
  32.  
  33.     foreach $line (<LINKSFILE>) {
  34.     ($category, $name, $url, $desc, $features) = split('|', $line);
  35.  
  36.     print $output "<B><a href=$url>$name</a></B><br>";
  37.     print $output "$desc";
  38.  
  39.     }
  40.  
  41.     print &Bottom;
  42.     close LOGFILE;
  43.  
  44. }
  45.  
  46. #########################################################################
  47.  
  48. #_____Module Returns the Output Document Type______#
  49. sub Header
  50. {
  51.         return "Content-type: text/html\n\n";
  52. }   
  53.  
  54. #_____Module Returns the Output Document Head_______#
  55. sub Top
  56. {
  57.         my ($title) = @_;
  58.         return <<"ENDPRINT";
  59. <HTML>
  60. <HEAD>
  61. <TITLE>acheron.org // admin / banner statistics</TITLE>
  62. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  63. </HEAD>
  64.  
  65. <BODY link="#FFCC00" vlink="#FF9900" alink="#FFFFFF" text="#cccccc" BGCOLOR="#000000">
  66. <div align="center">
  67.               <table border="0" width="640" align="center" cellspacing="0" cellpadding="0">
  68.                 <tr> 
  69.                   <td width="640"> 
  70.                     <p><font size="2" face="Arial, Helvetica, sans-serif">
  71. ENDPRINT
  72. }
  73.  
  74. #_____Module Returns the Output Document Bottom______#
  75. sub Bottom
  76. {
  77.         return "</td></tr></table></div></BODY></HTML>\n";
  78. }