Vocademy

An odd Apache error

While testing an input form, I got the following error:

Not Acceptable

An appropriate representation of the requested resource could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The short answer:

 You can't name an input field "comment" (not case sensitive) and type four characters into the field. You will get the above error upon submitting the form.

The long answer:

It took some time to track this one down, and I'm still unsure what the exact cause is (as far as I can find, "comment' is not a reserved word in PHP). It occurred when I put "fdsa" in a textarea, then submitted the form. Why "fdsa?" Because I was testing the form and just rolled my left hand's fingers across the keys. At first, I thought it was some JavaScript I was using to validate the email address in a different input field. When I put "fdsa" into that field, I got no error, but when I put "test@test.com," I got the error. I must have inadvertently put something other than "fdsa" in the textarea field when I didn't get the error.

After much trial and error, I confirmed that the "Not "Acceptable" error occurred when I had "fdsa" in the textarea field. One letter, less or more, didn't trigger the error.

I searched for information by copying and pasting the error text into a search engine (I didn't Google for an answer since I use DuckDuckGo). I found very little useful information but finally found the following page.

https://stackoverflow.com/questions/22087613/406-not-acceptable-error-on-form-submit

The page didn't have the answer, but it steered me in the right direction. The page says, "Don't name a form field "active" because that's a keyword. I thought that maybe I was naming the textarea field with a keyword. The field was named "Comment." I changed the name to "UserComment," and the error went away. I can't find where "Comment" is a reserved word. However, combining "comment" as a field name and typing four characters into that field triggers this error.

Problem solved...hopefully.

Vocademy