4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/local/bin/perl
$freelinks = '/system/path/to/freelinks.html';
$freelinksurl = 'http://www.yourdomainname.com/freelinks.html';
# Get the form variables
if ($ENV{'REQUEST_METHOD'} eq 'GET')
{
$querystring = $ENV{'QUERY_STRING'};
}
else
{
read(STDIN, $querystring, $ENV{'CONTENT_LENGTH'});
}
@arrnameval = split(/&/, $querystring);
foreach $namval (@arrnameval)
{
($nam, $val) = split(/=/, $namval);
# replace + with space
$val =~ tr/+/ /;
# translate hex values
$val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORMDATA{$nam} = $val;
}
$title = $FORMDATA{'yourtitle'};
$title =~ s/<[^>]*>//g;
$url = $FORMDATA{'yoururl'};
$url =~ s/<[^>]*>//g;
$category = $FORMDATA{'category'};
$category =~ s/<[^>]*>//g;
# Read content
open(FREELINKS,"$freelinks");
@arrfreelinks = <FREELINKS>;
close(FREELINKS);
#Save back new content
open(FREELINKS,">$freelinks");
foreach $line (@arrfreelinks)
{
print FREELINKS "$line";
if ($line =~ "--newentries$category--")
{
print FREELINKS "\n<font face=arial size=2> - <a href=$url targer=new>$title</a></font><br>\n";
}
}
close(FREELINKS);
print "Content-type: text/html\n";
$flinks = "$freelinksurl\n\n";
print qq(Location: $flinks);
return;
@sorted_data = sort @data
@sorted_data = sort { lc $a cmp lc $b } @data
4 Einträge, 1 Seite |