Quote:
Originally Posted by Vitaly
For some form, i need to implement such functionality:
1. Add 1 UINT parameter to form URL, when form is addressed
2. Disable form, if no parameter given
3. Send whis parameter in custom template via email (it will bу used to compose URL, such as "baselink/xxx/"."parameter")
That should be hidden from user interface.
What's the proper way to do that?
|
Import attached file.
form Hook: Form start
PHP Code:
$hiddenfield1 = $vbulletin->input->clean_gpc('g', 'param', TYPE_UINT);
if (empty($hiddenfield1))
{
$errormessage = "Error, this form needs a parameter.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
}
form Hook: Before Submit
PHP Code:
$hiddenfield1 = $vbulletin->input->clean_gpc('p', 'hiddenfield1', TYPE_UINT);
$formoutput = str_replace('{param}', "$hiddenfield1", $formoutput);
Then you can use {param} in custom output.