1
0
Fork 0
my_site_mk3/weblog/last_5.pl

38 lines
986 B
Perl

#!/usr/bin/perl
use CGI":standard";
require 'common.pl';
#parse cookies
my @cookieArray=split ("; ",$ENV{'HTTP_COOKIE'});
my $cookieName;my $cookieValue;my %cookieHash;
foreach (@cookieArray){
($cookieName,$cookieValue)=split("=",$_);
$cookieHash{$cookieName}=$cookieValue;
}
#parse GET input
if ($ENV{'QUERY_STRING'} ne '') {
@qstr = split (/=/,$ENV{'QUERY_STRING'});
$command = $qstr[0];
$value = $qstr[1];
$value =~ s/[\x00-\x20<>\|;\(\)\$^\+!\^\[\]\?\"\'\`]//g;
if ($command eq "random") {&randomPost;}
elsif ($command eq "write"){print redirect ('write.pl');}
else {&default;}
}
else {&default;}
#####SUBS
sub default{
&displaypost("temp.txt");
# &printHeader("Áëîã Àëåêñàíäðà ßêîâëåâà a.k.a. Oreolek");
# print "Ïîêà ïóñòî.\n<br>\n";
# &printFooter;
}
sub displaypost(){
$filename=shift;
open (MESSAGE,"$filename");
while (<MESSAGE>){
}
&printHeader("$title");
&printFooter;
}