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_Links.cgi
< prev
next >
Wrap
Text File
|
1999-02-09
|
3KB
|
89 lines
#!/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";
$temp = "";
# call initial functions
&Get_request_types;
&Analyse_file;
#########################################################################
sub Get_request_types {
&ReadParse(*input);
$name_in = ($input{'name'});
}
#########################################################################
sub Analyse_file {
print &Header;
print &Top("test");
$output = "STDOUT";
## open links file for reading and determine whether current entries match
## the given one - if yes then it is not printed to the temp links file.
open (LOGFILE, "<links.txt") || die "Could not open or find $filename\n";
foreach $line (<LOGFILE>) {
($category, $name, $url, $desc) = split(' : ', $line);
if ($name_in eq $name) {
## print output form with fields filled in
print $output "<form action=\"/cgi-bin/modify_Links.cgi\" method=\"GET\">\n";
print $output "<input type=\"hidden\" name=\"category\" value=\"$category\">\n";
print $output "<input type=\"hidden\" name=\"name\" value=\"$name_in\">\n";
print $output "Name<br><input type=\"text\" name=\"newname\" value=\"$name\">\n";
print $output "<p>URL<br><input type=text name=url value=\"$url\">\n";
print $output "<p>Description<br><input type=\"text\" name=\"desc\" value=\"$desc\"><P>\n";
print $output "<input type=\"submit\" name=\"submit\" value=\"submit\">\n";
print $output "</form>";
}
}
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";
<HTML>
<HEAD>
<TITLE>acheron.org // admin / banner statistics</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY link="#FFCC00" vlink="#FF9900" alink="#FFFFFF" text="#cccccc" BGCOLOR="#000000">
<div align="center">
<table border="0" width="640" align="center" cellspacing="0" cellpadding="0">
<tr>
<td width="640">
<p><font size="2" face="Arial, Helvetica, sans-serif">
ENDPRINT
}
#_____Module Returns the Output Document Bottom______#
sub Bottom
{
return "</td></tr></table></div></BODY></HTML>\n";
}