-1

htmlファイル内のデータ「テキスト」タイプを返すperlスクリプトを呼び出す方法.参照用にperlスクリプトを投稿する.このスクリプトはindex.htmlで呼び出す必要があるため、その方法

#!/usr/bin/perl -w  

use CGI;  

my $cgi = CGI->new;  
my $remote = $cgi->remote_host();  

my $AB = "16.108";  
my $CD = "16.214";  
my $EF = "10.99";  
my $GH = "10.243";  
my $XY = "10.179";  

my @remote_ip_values = split(/\./, $remote);  

my $remote_ip = $remote_ip_values[0] .".". $remote_ip_values[1];  

print "Content-type: text/html\n\n";  
print "document.write(\"<style>\\n\");\n";  
print "document.write(\"font color:red;\\n\");\n";  


if ($remote_ip eq $AB)  
{  
print "document.write(\"SUCCESSFUL\");\n";  

}  
 else  
{  
print "document.write(\"TEST\");\n";  
}  
exit;  
4

1 に答える 1