Development Wiki

Function.add form key

From phpBB Development Wiki

Revision as of 21:13, 23 September 2008 by Erik frèrejean (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

add_form_key -- Add a secret token to the form.


  1. void add_form_key (String $form_name)

This functions adds a secret token to any form, this token can be checked after submission with the check_form_key function to ensure that the received data is the same as the submitted.

Note: This function expects that the {S_FORM_TOKEN} template variable is present in the template that is used for the selected page!


Parameter Usage
form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply.


Example #1 Add a form token

To add the form token you only have to call the function.


See Also