View Single Post
Old 07-06-2009, 01:15 PM   #5 (permalink)
CoryMathews
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

This sort of seems like overkill to use exceptions. Personally I just use a string.

PHP Code:
if(!validDate) {
  
errorMsg += "problem with date<br />";
}
...
if(
errorMsg == "") {
  
// valid input continue with form
} else {
  
// show error msg for bad input

CoryMathews is offline  
Reply With Quote