I'm looking for advice on a combination PHP/MySQL programing and human factors problem.
Last week, I threw together a form to allow anglers to report tagged fish to us. It's PHP and on Submit, it writes a record to a MySQL database. If one of the four required fields out of the 8 fields are not submitted, the script rejects the record and tells the angler to use the back button and try again.
I've been vacillating about how to handle the date input on the form. While I show them the format I'd like on the form so it works with datetime, yyyy-mm-dd, I haven't made the date a required field. Since the date is stored in a datetime field in the database, currently if an angler enters a date in a different format, the date is blank in the record.
I've been thinking that since the date is not as important as the tag report, I don't want to frustrate the angler by giving him an error message and requiring him to go back and try the date entry again. Rather than extensive programming to recognize and convert many different date formats, I thought that I might instead catch the date input from the form in a new string field as well, so later a human can interpret it. I think at the most I'll get around 100, maybe less, with this form.
Recently, my colleges have suggested that a calendar control might work on the page, so the angler might point and click a little calendar to construct the date in the correct format, like they might have seen on online payment sites. But I'm not so sure that it would be easier for the public to use such a control, and so far, the only one's I've found are the kind used to schedule events on a calendar. Are there some free/shareware php srcipts or code examples just to help date entry out there?
One thing I've considered in to split the date into three boxes on the form: year, month, and day, check the year and make it 2010 if only 10 is entered, then calculate the datetime field from the three variables.
Have you ever had trouble with hackers finding your form and entering a bunch of garbage? Links to Russian porn, that kind of thing?
This signature line intentionally blank.