Validating date in php
You can use this value to display an error, halt further execution of the script, or write to an error log.
To see how this plays out in the real world, let's create a simple HTML form and then use Validate to test the integrity of the data entered into it.
The Validate class comes with a number of built-in input validation methods, which are described in Table A.
So, if you need to test if a particular chunk of data conforms to, say, the format for an e-mail address, all you need to do is pass it to Validate'semail() method, which will check it for you and return a true/false value.
Most experienced Web developers are acutely aware that the single most vulnerable point of any Web application is its forms.Yep agree, datepicker will enable you to decide which format to display the date (and possibly which format to send - depending on the datepicker itself).However, validation and error-checking/reporting is still your call.The first method (function) in this class will accept input from the user, validate it, and format it ready for writing to the database.The user may input a date in a number of different ways, so we will use regular expressions to help us decipher the user's input.
Search for validating date in php:
Defence in Depth is essential when dealing with passed form variables.