| px | top | add code | search | signup | login | help |
<?
//##############################################################
// htmlDateDrawTest.php3
//
// a demonstrations script for the htmlDateDraw.php3 library
//
// Tony J. White 1999-04-06 tjw@tjw.org
//##############################################################
// where the magic happens
include( "htmlDateDraw.php3");
// interpret the form into a UNIX time (seconds since 1/1/1970)
// be sure to use $HTTP_POST_VARS if the form method=post
$date = readDate( "foo", $HTTP_GET_VARS);
// use my birthday (well the date part anyway), if the form is empty
if (!existsDate( "foo", $HTTP_GET_VARS)) $date = mktime(11,30,0,2,20,1977);
echo "<form>";
// draw the date named "foo" inside the form
drawDate( "foo", $date, 3);
echo "<input type=submit></form>";
echo "<hr>";
// NOTE: if you use a mode 2 for drawing, the result will be
// the number of seconds past 1/1/1970 00:00:00
//
if (existsDate( "foo", $HTTP_GET_VARS)) {
//behold the output of readDate
echo "UNIX Date: ".$date. "<br>";
//make the UNIX date readable to americans
echo "prettyDateTime(): ".prettyDateTime($date);
}
else {
echo "NO DATE SUBMITTED";
}
?>
<hr>
<br>
<a href="htmlDateDrawTest.phps">
Source for THIS SCRIPT</a>
<br>
<br>
<a href="htmlDateDraw.phps">
Source for htmlDateDraw.php3</a>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.