asherinho Posted August 6, 2007 Share Posted August 6, 2007 wats up friends?,I am having a problem with validation.I created a form which requires the user to enter date and the date field in the database accepts only these formats year-month-day, year.month.day or year/month/day.Below are the codes i used,the problem is if the user enters the date in either of these format day-month-year, day.month.year or day/month/year the error message is not displayed and the values are sent as null values to the database.Any one to assist me please if(!eregi("^[0-9]+[.\-\/]+[0-9]+[.\-\/]+[0-9]+$",$datesent)){the date format is not one of the recomended which are:- year.month.day/year.month.day/year-month-day</p>"; exit;} Quote Link to comment https://forums.phpfreaks.com/topic/63504-date-input-validation/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.