in reply to "Action" variables and form data
There are two ways of submitting data to a CGI program, get and post. CGI will transparently switch to the appropriate one, but it does not accept some variables from get and some from post.
Therefore take the action out of the query string (which is trying to pass it through a get when you are using the post method) and instead add a hidden form element that looks like this:
<input type="hidden" name="action" value="additem">