Function.add form key

add_form_key -- Add a secret token to the form.

Description
This functions adds a secret token to any form, a token which should be checked after submission with the check_form_key function to ensure that the received data is the same as the submitted.
 * 1) void add_form_key (String $form_name)


 * Note: This function expects that the {S_FORM_TOKEN} template variable is present in the template file being used!

Example #1 Add a form token
To add the form token you only have to call the function. $form_key = 'my_form'; add_form_key($form_key);

Example #2 Usage with check_form_key
Basic add_form_key usage with the check_form_key function. $form_key = 'my_form'; add_form_key($form_key);

if (!check_form_key($form_key)) {   $errors[] = $user->lang['FORM_INVALID']; }