965 :
(1/2):
#!/usr/bin/perl
$|=1;
if($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN, $buf, $ENV{'CONTENT_LENGTH'});
foreach $str (split(/\&/, $buf)) {
($key, $val) = split(/=/, $str, 2);
$in{$key} = $val;
}
}else{
$buf = $ENV{'QUERY_STRING'};
foreach $str (split(/\&/, $buf)) {
($key, $val) = split(/=/, $str, 2);
$in{$key} = $val;
}
}
open(LOG, 'SEX.txt');
$buf = <LOG>;
close(LOG);
($SEXMALE, $SEXFEMALE) = split(/,/, $buf, 2);
if($in{'GENDER'} eq '0'){ $SEXMALE++; }
else{ $SEXFEMALE++; }
open(LOG, '>SEX.txt');
print LOG "$SEXMALE,$SEXFEMALE";
close(LOG);
966 :
(2/2):2005/11/30(水) 21:14:01 ID:???
$SEXSUM = $SEXMALE + $SEXFEMALE;
print 'Content-Type: text/html', "\n\n";
print << "_END_";
<html>
<head>
</head>
<body>
性別<br><br>
回答者合計者 $SEXSUM 名中<br><br>
男 $SEXMALE 名<br>
女 $SEXFEMALE 名
</body>
</html>
_END_
一応条件は満たしてるはずだ
967 :
(3/2):2005/11/30(水) 21:16:39 ID:???
else{ $SEXFEMALE++; }
を
if($in{'GENDER'} eq '1'){ $SEXFEMALE++; }
に変えといた方がええかもしれん