Aurai
[E-Mail]
1999/12/19(日) 04:25:57
ディレクトリがnobodyのせいでしょうか
こんな内容のスクリプトを使ってみるとか
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
require 'jcode.pl';
read(STDIN, $query_string, $ENV{'CONTENT_LENGTH'});
@a = split(/&/, $query_string);
foreach $x (@a) {
($name, $value) = split(/=/, $x);
$value =~ tr/+/ /;
$value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg;
$value =~ s/(\x0d\x0a|\x0d)/\x0a/g;
&jcode'convert(*value,'sjis');
$FORM{$name} = $value;
}
}
if ($FORM{'ACTION'} eq 'WRITE') {
open(OUT,"> $FORM{'FILENAME'}");
print OUT $FORM{'CONTENT'};
close(OUT);
$mes = "\"$FORM{'FILENAME'}\" に書き込みました。"
} elsif($FORM{'ACTION'} eq 'READ') {
open(IN,"$FORM{'FILENAME'}");
@lines = <IN>;
close(IN);
$FORM{'CONTENT'} = join('',@lines);
$mes = "\"$FORM{'FILENAME'}\" を読み込みました。"
}
$FORM{'CONTENT'} =~ s/&/&/g;
$FORM{'CONTENT'} =~ s/"/"/g;
$FORM{'CONTENT'} =~ s/</</g;
$FORM{'CONTENT'} =~ s/>/>/g;
$FORM{'FILENAME'} =~ s/&/&/g;
$FORM{'FILENAME'} =~ s/"/"/g;
$FORM{'FILENAME'} =~ s/</</g;
$FORM{'FILENAME'} =~ s/>/>/g;
print "Content-type: text/html\n\n";
print "<html><head><title>FILEUPLOAD</title></head><body>\n";
print "$mes<br><br>\n";
print "<form method=\"POST\">";
print "ACTION:<br><input type=\"radio\" name=\"ACTION\" value=\"READ\" checked>READ <input type=\"radio\" name=\"ACTION\" value=\"WRITE\">WRITE<br><br>\n";
print "FILENAME:<br><input type=\"text\" name=\"FILENAME\" value=\"$FORM{'FILENAME'}\" size=80><input type=\"submit\" value=\"SUBMIT\"><br><br>\n";
print "CONTENT:<br><textarea name=\"CONTENT\" cols=120 rows=24>$FORM{'CONTENT'}</textarea><br>\n";
print "</form></body></html>";