MyBB Community Forums

Full Version: Developing for the Admin CP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have an admin module. there is a form on one page, and it submits to another, and stores the data to the database. It works, and the data stores, but it shows
An authorization code mismatch occurred. Please confirm that you wish to perform the action below.
instead of a confirmation I made.

How should I fix it?
Not possible to answer without a lot more details. See how other forms work with authorization codes (to prevent someone passing admin a link to an admincp site and involuntarily executing something he doesn't want to be executed by clicking / submitting the link). Same is done for the forum itself by the way, so you can't just give a user a link that would delete one of his posts or something.
On almost all ACP pages, the my_post_key is checked to validate. If you're using the default form handler, this shouldn't be an issue.

You can pass the my_post_key along with the form.

When the post_key is checked, exclusions can be added to an array - however, I don't think this has ever worked but it's something I'm looking into.
I'm not, I'm using a <form> tag. What would I need to include to make it work?
echo '<input type="hidden" name="my_post_key" value="'.$mybb->post_code.'" />';