G
Greg
I write a very simple CGI using perl,here is the html
<HTML>
<HEAD>
<TITLE>Welcome Page</TITLE>
</HEAD>
<BODY>
Welcome to this web page. Currently, out my window I see:
<!--#exec cgi="/cig-bin/sunmoon.cgi"-->
</BODY>
<HTML>
Following is the sunmoon.cgi
#!/usr/bin/perl -w
use CGI qw
all);
my $hour=(localtime)[2];
my $image;
if($hour<6 or $hour >18){
$image="night.jpg";
}else{
$image="day.jpg";
}
print header;
print qq{<IMG SRC="$image" ALT="$image">\n};
The two image files are there, but it can not be shown on the webpage,
the webpage only shows:
Welcome to this web page. Currently, out my window I see:
What the problem? it seems the cgi was not executed. Thanks!
<HTML>
<HEAD>
<TITLE>Welcome Page</TITLE>
</HEAD>
<BODY>
Welcome to this web page. Currently, out my window I see:
<!--#exec cgi="/cig-bin/sunmoon.cgi"-->
</BODY>
<HTML>
Following is the sunmoon.cgi
#!/usr/bin/perl -w
use CGI qw
my $hour=(localtime)[2];
my $image;
if($hour<6 or $hour >18){
$image="night.jpg";
}else{
$image="day.jpg";
}
print header;
print qq{<IMG SRC="$image" ALT="$image">\n};
The two image files are there, but it can not be shown on the webpage,
the webpage only shows:
Welcome to this web page. Currently, out my window I see:
What the problem? it seems the cgi was not executed. Thanks!