Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501

Deprecated: Function create_function() is deprecated in /opt/lampp/htdocs/aiedam/aiesite/pmwiki.php on line 501
AIEDAM - ZAPSupport-Tutorials - FormsInSidebars

Tutorials Support > Tutorials > FormsInSidebars

Because of the way PmWiki processes page output, you cannot safely assign session variables in Sidebars or any other part of the page defined by your skin. (Groupheaders and Groupfooters are considered part of the main page and work fine). There is a workaround however. Essentially, you put the parts of the form that assign session variables in the main part of the page. Then you put the remaining parts of the form in the Sidebar.

Let's try putting the following snippet in your Sidebar. It is the snippet used to test whether or not ZAP is properly installed on your system. If your version of php has error reporting turned on, pasting this into a Sidebar will likely give some ugly php messages. Try it if you like:

(:zapform key=check:)(:zapget:)
(:zap Install="Installation Successful" check:)
(:zap passdata="Install" check:)
(:input submit value="Test Install":)\\
{$Install}
(:zapend:)

What we need to do is set the zapform session variables in the main page, including any zapfields you need. In the above example you might put this. Note the form key is explicitly defined:

(:zapform key=check:)
(:zap Install="Installation Successful" check:)
(:zap passdata="Install" check:)
(:zapend:)

Now in the Sidebar, we'll create a form containing the remaining input fields of the form, and a couple special hidden fields to trigger the zap engine, like this:

(:input form:)
(:input hidden action "zap":)
(:input hidden ZAPkey "check":)
(:input submit value="Test Install":)\\
{$Install}
(:input end:)

The hidden action field tells PmWiki to call the ZAP engine, and the hidden ZAPkey field, tells ZAP which session variable information to retrieve for the form submission. That's all there is to it.