Вот и скрипт:
#!/usr/bin/perl
use DBI;
use CGI qw(:standard);
####
sub urldecode{
local($val)=@_;
$val=~s/\\+/ /g;
$val=~s/%([0-9A-H]{2})/pack(\'C\',hex($1))/ge;
return $val;
}
####
if($ENV{\'REQUEST_METHOD\'} eq \'GET\')
{$query=$ENV{\'QUERY_STRING\'};}
elsif($ENV{\'REQUEST_METHOD\'} eq \'POST\')
{sysread STDIN,$query,$ENV{\'CONTENT_LENGTH\'};}
####
@formfields=split(/&/,$query);
foreach(@formfields){
$name = param(\'name\');
$pass = param(\'pass\');
$news = param(\'news\');
$head = param(\'head\');
# if(/^name=(.*)/){$name=&urldecode($1);}
# if(/^pass=(.*)/){$pass=&urldecode($1);}
# if(/^news=(.*)/){$news=&urldecode($1);}
# if(/^head=(.*)/){$head=&urldecode($1);}
}
####
print "Content-Type: text/html\\n\\n";
($day,$month,$year) = (localtime)[3,4,5];
$month=$month+1;
$year=$year+1900;
$date="$year:$month:$day";
print "\\n";
print "
\\n"; print "$day.$month.$year |
\\n";
print "
\\n"; print "$head\\n"; print " $news |
\\n";
print "OK, click
http://www.techno.spb.ru"> here to finish process\\n";
print "\\n";