MyBB Community Forums

Full Version: nonce codes and other front-end form coding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I need to develop a front-end form for my plugins, generally I usually use nonce codes for this.

FYI for those that don't know a nonce code is just a string that allows you to verify that the form has come from the site that is receiving it as well as makes sure that a form is only submitted once. It just prevents people from tampering with user inputs as well as makes sure you are getting expected responses.

In Joomla you usually put in a form code call which did all this for you. I am wondering if there is a mybb equivalent or anything else I should be using for the forms on the front-end of my plugins?

Dan
You can use the verify_post_check() function, newthread.php has three examples.
Yeah the verify isnt too hard but how about nonce codes in general I think nonce is an important security implemwntation for any form based scripts.

Ill consider coding my own
{$mybb->post_code} is what you're looking for for a CSRF token.
Cheers ill play with that

That was the one, worked perfectly thank you