#!/usr/bin/perl @days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); @shortdays = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); @months = ("January","February","March","April","May","June","July","August","September","October","November","December"); @shortmonths = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); ($sec,$min,$hr,$mday,$mon,$cyear,$wday,$yday,$isdst) = localtime(time); $longyr = $cyear + 1900; $fixmo = $mon + 1; if ($isdst == 1) { $tz = "CDT"; } else { $tz = "CST"; } $data_file="tipsdata.cgi"; open(DAT, $data_file) || die("Could not open file!"); @raw_data=; close(DAT); print "Content-type: text/html\n\n"; foreach $tip (@raw_data) { chop($tip); ($month,$day,$year,$tipoftheweek)=split(/\|/,$tip); if (($year==$longyr)) { if ((($month==$fixmo) && ($mday>$day))||(($month<$fixmo) && ($mday<=$day))) { $currenttip=$tipoftheweek; $currentmonth=$month; $currentday=$day; } $currentyear=$year; } } $Now=time(); $dayno=(localtime)[6]; print < realdiscipline.com - the site for raising responsible children.
   Tip of the Week

Week of $months[$currentmonth-1] $currentday, $currentyear


"$currenttip"


©1999-2003 Woodstream Publishing™, Inc.  All Rights Reserved

Terms of Use

Any School and/or Organization has the ability to use the current tip of the week or a previous tip of the week in any type of publication as long as the source of the tip is included.  e.g. Tip obtained from www.realdiscipline.com - Author : Ron Morrish
 

 

Tip Archives




 
EndHTML