This code consists of two parts, the first part is a .html file that uses a form to pass 3 date variables into day_of_week.php3 You input the mm/dd/yyyy of the day then
it prints what day of the week that day falls on.
/*
* I'm still a new PHP developer, and am FAR from anything great, however
* I have a few pretty cool toys including my Custom Home Page Maker on
* my website at http://temple.lod.com/alucard/
* Please feel free to drop by, and check out my work, and give ideas,
* comments or suggestions. I could use all the help I can get.
*/
// This should be a .html file... like day.html
<html>
<FORM ENCTYPE="multipart/form-data" ACTION="day_of_week.php3" METHOD=POST>
<table border=0 width=100%>
<tr>
<td bgcolor=redorange colspan=2>
<center><h3>Date Selector</h3></center>
This little program will find what day of the week a date falls on inbetween
the years <b>1969</b> and
<b>2035</b>. To use this just type in the Day/Month/Year in numeric form. *For
example September 14th, 1976
is 9/14/1976*
</td>
</tr>
<tr>
<td width=50% bgcolor=redorange><b>Enter a date: (mm/dd/yyyy)</b></td>
<td width=50% bgcolor=redorange align=center>
<INPUT NAME="month" TYPE="text" size="4" MAXLENGTH=2> /
<INPUT NAME="day" TYPE="text" size="4" MAXLENGTH=2> /
<INPUT NAME="year" TYPE="text" size="4" MAXLENGTH=4>
<INPUT TYPE="submit" VALUE=" Find Day of Week "></td>
</tr>
</table>
</FORM>
</html>
// This goes in day_of_week.php3
<html>
<center><h1>
<?
if (checkdate($month,$day,$year) && ($year <= 2035 && $year >= 1969))
{
echo date( "F d, Y", mktime(0,0,0,$month,$day,$year) );
print(" is on a " . date("l<br>", mktime(0,0,0,$month,$day,$year)));
}
else { echo("Invalid DATE"); }
?>
</h1></center>