I want to get the date from the user and compare that date to another one. How can I store the submitted date in a variable?
I tried this code:-
$month = 2;
$year = 2012;
$saturday = strtotime('First Saturday '.date('F o', mktime(0,0,0, $month, 1, $year)));
echo date('Y/M/d', $saturday);
In $saturday
I calculated the date now I want to take another date from the user and compare that date to $saturday
.
How can I do this?
you needs to create a form and an input element with submit button and then when user submit that form you will be having the data in the POST or GET variable according to the method specified in the form.