export_form_vars (public, deprecated)
export_form_vars [ -sign ] [ args... ]
Defined in packages/acs-tcl/tcl/deprecated-procs.tcl
Deprecated. Invoking this procedure generates a warning.
Exports a number of variables as hidden input fields in a form. Specify a list of variable names. The proc will reach up in the caller's name space to grab the value of the variables. Variables that are not defined are silently ignored. You can append :multiple to the name of a variable. In this case, the value will be treated as a list, and each of the elements output separately.
export_vars is now the preferred interface.
Example usage:
[export_vars -form -sign {foo bar:multiple baz}]
- Switches:
- -sign (optional, boolean)
- If this flag is set, all the variables output will be signed using
ad_sign. These variables should then be verified using the :verify flag toad_page_contract, which in turn usesad_verify_signature. This ensures that the value hasn't been tampered with at the user's end.- See Also:
- Testcases:
- No testcase defined.
Source code: ad_log_deprecated proc export_form_vars set hidden "" foreach var_spec $args { lassign [split $var_spec ":"] var type upvar 1 $var value if { [info exists value] } { switch -- $type { multiple { foreach item $value { append hidden "<input type=\"hidden\" name=\"[ns_quotehtml $var]\" value=\"[ns_quotehtml $item]\" >\n" } } default { append hidden "<input type=\"hidden\" name=\"[ns_quotehtml $var]\" value=\"[ns_quotehtml $value]\" >\n" } } if { $sign_p } { append hidden "<input type=\"hidden\" name=\"[ns_quotehtml "$var:sig"]\" value=\"[ns_quotehtml [ad_sign $value]]\" >\n" } } } return $hiddenXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/deprecated-procs.xql