|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-17 07:50 UTC] hholzgra at cvs dot php dot net
[2000-07-30 13:39 UTC] zak@php.net
[2000-08-06 18:43 UTC] stas@php.net
[2000-08-06 23:44 UTC] hholzgra@php.net
[2000-08-08 08:37 UTC] stas@php.net
[2000-08-08 08:58 UTC] waldschrott@php.net
[2000-09-02 19:32 UTC] sniper@php.net
[2000-10-02 19:05 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jan 05 02:00:02 2026 UTC |
Please check date function bug save this script as "birth.php" and enter "19650331" my birthday. On Linux, It's Okey but, php4ts.dll error would be happen on Win98 with Apach Webserver. PWS does it also. <? echo(" <form action=birth.php method=post> <tr> <td align=right>Birth(YYYYMMDD): </td> <td><input type=text name=\"birth\" size=8 maxlength=8></td> </tr> <tr> <td align=center><input type=submit value=\"Check!\"></form></td> </tr>"); // Birthday Checking if (strlen($birth) == 8) { for ($i = 0; $i < 8; $i++) { $a[$i] = intval($birth[$i]); } // Birthday checking $Y = $a[0]*1000 + $a[1]*100 + $a[2]*10 + $a[3]; $M = $a[4]*10 + $a[5]; if (($M == 0) || ($M >12)) error("Invalid Month"); $D = $a[6]*10 + $a[7]; if (($D == 0) || ($D >31)) error("Invalid Day"); $b_date = mktime(0, 0, 0, "$M", "$D", "$Y"); $b_date = date("Y-m-d", $b_date); echo ( "Birth : $b_date"); } else { echo("Invalid Input"); } ?> <?php phpinfo(); ?>