Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Problem using a form in a plugin


Sam Bauers
Participant

@sambauers

I think you are misunderstanding how PHP is used to process forms. You can’t call a PHP function using an “onclick” event.

PHP is a server side pre-processor, not a client side scripting language. The form needs to be posted, then you need to somehow trigger the php function on the recipient page. In bbPress, this is done by hooking into the API.

Read this… http://www.php.net/manual/en/tutorial.forms.php

Then I suggest you download and copy the methods used in another plugin that does this. No one will mind you copying their methods. You can feel free to adapt from any of my plugins that do this. “LDAP authentication” does it, so does “Restrict registration”. The code for handling admin pages is at the bottom of both plugins. These will also give you a clue as to how to implement the bb_*_option functions.

Skip to toolbar