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 / retrieve_Channels.cgi < prev    next >
Text File  |  1999-02-12  |  3KB  |  88 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. $temp = "";
  10.  
  11. # call initial functions
  12. &Get_request_types;
  13. &Analyse_file;
  14.  
  15. #########################################################################
  16.  
  17. sub Get_request_types {
  18.         
  19. &ReadParse(*input);
  20. $name_in = ($input{'name'});
  21.  
  22. }
  23.  
  24. #########################################################################
  25.  
  26. sub Analyse_file {
  27.  
  28. print &Header;
  29. print &Top("test");
  30. $output = "STDOUT";
  31.  
  32. ## open links file for reading and determine whether current entries match 
  33. ## the given one - if yes then it is not printed to the temp links file.
  34. open (LOGFILE, "<links.txt") || die "Could not open or find $filename\n";
  35.  
  36.     foreach $line (<LOGFILE>) {
  37.     ($category, $name, $desc) = split(' : ', $line);
  38.          if ($name_in eq $name) {
  39.             ## print output form with fields filled in
  40.             print $output "<form action=\"/cgi-bin/modify_Channels.cgi\" method=\"GET\">\n";
  41.             print $output "<input type=\"hidden\" name=\"category\" value=\"$category\">\n";
  42.             print $output "<input type=\"hidden\" name=\"name\" value=\"$name_in\">\n";
  43.             print $output "Name<br><input type=\"text\" name=\"newname\" value=\"$name\">\n";
  44.             print $output "<p>Description<br><input type=\"text\" name=\"desc\" value=\"$desc\"><P>\n";
  45.             print $output "<input type=\"submit\" name=\"submit\" value=\"submit\">\n";
  46.             print $output "</form>";
  47.    
  48.          }   
  49.     }
  50. close (LOGFILE);
  51.  
  52. print &Bottom;
  53.  
  54. }
  55.  
  56. #########################################################################
  57.  
  58. #_____Module Returns the Output Document Type______#
  59. sub Header
  60. {
  61.         return "Content-type: text/html\n\n";
  62. }   
  63.  
  64. #_____Module Returns the Output Document Head_______#
  65. sub Top
  66. {
  67.         my ($title) = @_;
  68.         return <<"ENDPRINT";
  69. <HTML>
  70. <HEAD>
  71. <TITLE>acheron.org // admin / modifying a channel - changing the data</TITLE>
  72. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  73. </HEAD>
  74.  
  75. <BODY link="#FFCC00" vlink="#FF9900" alink="#FFFFFF" text="#cccccc" BGCOLOR="#000000">
  76. <div align="center">
  77.               <table border="0" width="640" align="center" cellspacing="0" cellpadding="0">
  78.                 <tr> 
  79.                   <td width="640"> 
  80.                     <p><font size="2" face="Arial, Helvetica, sans-serif">
  81. ENDPRINT
  82. }
  83.  
  84. #_____Module Returns the Output Document Bottom______#
  85. sub Bottom
  86. {
  87.         return "</td></tr></table></div></BODY></HTML>\n";
  88. }