Hello, I want to check if todays date is larger then a given date.
This is the script i have so far:
<?php
$givenDate ="12-11-2003";
$today = date("d-m-Y");
if ($today > $givendate)
{
echo "<b>Wrong!</b> you cannot specify a date in the past, your a naughty boy/girl!";
}
else
{
echo "you specified<br>";
echo $givenDate;
echo "<br>as your date of death.<br>";
}
?>
This seems to work but....
if I set
$givenDate ="01-11-2004";
it will still tell me I am a naughty girl. which is wrong because obviously 2004 is not in the past.
So who can give me an example or tell me how i can see if a given date lies in the future?
I hope you can help me,
greetz from NiQuil