help on date
Posted: Tue Sep 06, 2005 4:39 am
i have a code here
the idea is that when the textboxes are null, the $error will prompt....and if it is not null, it will check is the (month will not not be <= 0 or >= 13) or (day will not be <= 0 or >= 32) or (year will not be <= 0 or >= 10000) else, the error message will prompt the user....the problem with the above code is that, it does not work....please help me modify the above code....your help will be gladly apperciated....thanks in advance 
Code: Select all
//check for project duration start date
if (empty($_POST['startmonth']) || empty($_POST['startday']) || empty($_POST['startyear']))
{
if ($_POST['startmonth'] <= 0 || $_POST['startmonth'] >= 13 || $_POST['startday'] <= 0 || $_POST['startday'] >= 32 || $_POST['startyear'] <= 0 || $_POST['startyear'] >= 10000)
{
$sd = false;
$error['startmonth'] = '<font color=red />Please enter proper start date<br>';
}
}
else
{
$sd = $_POST['startyear']."-".$_POST['startmonth']."-".$_POST['startday'];
}