A Tricky Forms Problem
I recently wrote a WordPress plug-in that incorporated a form. The page displayed just fine, but whenever I posted the form’s results Apache returned a 404 Page Not Found error. How could that be? I was just on that page!
The Internet To The Rescue
A search of the issue resulted in me finding this page, which exactly described my problem and why it was happening. It turns out that there are a whole raft of reserved names from form input elements, and one of them, “hour”, I was using. This was the cause of the problem. As soon as I changed it to something not likely to be reserved, the form post worked just fine.
The Lesson Learned
Because it is impossible to know all the reserved words, and they probably change all the time, the best way is to prefix all your input name tags with something that will not likely appear in the list. For example:
<input type=”text” name=”tgg_hour”>
It really doesn’t matter what the prefix is, just make it something unusual.
List of reserved names in $_POST and $_REQUEST used by WordPress 3.5
In case the above link is broken I have reproduced the list below. As the original author said, it’s probably incomplete.