stevesimo Posted April 18, 2007 Share Posted April 18, 2007 Hi I need to validate a date entered to make sure it isnt before the current date. I have managed to this in Javascript but not sure how to do this in PHP when the value is submitted. Anyone got any ideas? Link to comment https://forums.phpfreaks.com/topic/47566-solved-check-date-is-not-before-current-date/ Share on other sites More sharing options...
clown[NOR] Posted April 18, 2007 Share Posted April 18, 2007 have the date submitted using this format yyyy-mm-dd then to this $today = date("Y-m-d"); if ($date > $today) { echo "this after today"; } else { echo "this is before today"; } Link to comment https://forums.phpfreaks.com/topic/47566-solved-check-date-is-not-before-current-date/#findComment-232221 Share on other sites More sharing options...
stevesimo Posted April 18, 2007 Author Share Posted April 18, 2007 thanks for the help, that worked cheers, steve Link to comment https://forums.phpfreaks.com/topic/47566-solved-check-date-is-not-before-current-date/#findComment-232231 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.