---------------
#!/usr/bin/perl
use CGI;
if(&date eq '2004')
{
print "<img src=\"graphics/holiday-welcomes/Welcome_fourth.jpg\" alt=\"IronMagma is Celebrating the Fourth of July!\">";
}
else
{
@images=('welcome_dust.gif','Welcome_.gif','rwlogo.gif','linux.gif');
@alt=('Dust','Linux RedHat','RealityWebs','Linux');
@links=('galleries/f/v/dust.shtml','121x45','195x88','182x78');
srand; $num=int(rand(scalar(@images))); print "Content-Type: text/html\n\n<a href=\"../$links[$num]\"><img src=\"graphics/$images[$num]\" border=0 alt=\"$alt[$num]\" width=300 height=300></a>";
}
print "-";
print &date;
print "-";
sub year {
@dates=localtime();
$dates[5]+=1900;
$dates[4]++;
$final=sprintf("%0.2d", $dates[5]);
return $final;
}
sub date {
@date=localtime();
$date[4]++;
$fina=sprintf("%0.2d", $date[4])."/".sprintf("%0.2d", $date[3]);
return $fina;
}
[edited by: jatar_k at 6:21 pm (utc) on Oct. 21, 2004]
[edit reason] removed urls [/edit]
print "Content-type:text/html\n\n";
, it appears on the page as Content-type:text/html
\n
\n.
Whenever I run this script, it just runs the defined else{. it doesn't run the if( statement because for some reason, it simply won't compare the two strings.