Creating Websites That Work! Call Toll Free at 1-877-530-7993 For Assistance With Your Web Needs.
Design Solutions
E-commerce
Hosting Plans
Other Services
PERL - Countdown

1.) Upload to your cgi directory, chmod 755. You can call it either through your browser or using an include statement in your SSI file.

Call like this...at the end of the ? put the month(lower case), then an *, then the day.
http://yourdomain/cgi-directory/countdown.cgi?may*18

#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

# Set your font colors
$today_font_color="#FF0000";
$tomorrow_font_color="#000080";

$target_date=$ENV{QUERY_STRING};
($m,$d)=split/\*/,$target_date;
$m=uc($m);
$days_till="$m $d";
%month= ( 'JAN',0,'FEB',31,'MAR',59,'APR',90,'MAY',120,'JUN',151,
'JUL',181,'AUG',212,'SEP',243,'OCT',273,'NOV',304,'DEC',334 );
($sec,$min,$hour,$mday,$mon,$year,$wday,$days_now,$isdst)=localtime(time);
$days_now++;
($gmonth,$gday)=split(' ',$days_till);
$days_till = $month{$gmonth} + $gday;

if ($days_now > $days_till)
{
$total=($days_till+(364-$days_now));
}
else {
$total= $days_till-$days_now;
}
print qq~
<font size=2>$m $d is
~;
if ($total ==0){
print qq~
<font size=2 color=$today_font_color>Today!</font>
~;
}
elsif ($total ==1){
print qq~
<font size=2>only</font>
<font size=2 color=$tomorrow_font_color>$total</font><font size=2> day away</font>
~;
}
else {
print qq~
<font size=2>$total days away</font>
~;
}
exit;


  

Learning Center
About Us
Create-A-Website provides you with professional custom web solutions at affordable prices!