Reputation: 2976
What would be the easiest way to create a contact form that saves the answer to a prize game's question to the wordpress database?
I already tried the combination of the two plugins "contact form" and "contact form to database" but customisation is only possible in the premium version.
Are there any existing plugins that could do what I need? If not, how to create something that could do it?
I guess I would have to create an options page in functions.php of the theme:
Then I would need a contact form plugin:
if(isset $_POST[...])
and saves the post to the database with wp->insertAm I right? Or is there an easier way to solve that problem?
I would appreciate some tips, links or code snippets. :)
Upvotes: 0
Views: 4121
Reputation: 10190
Use Contact Form 7 and the Contact Form DB plugins.
CF7 is a great and easy to use email form generator plugin, and CFDB is an extension for it that allows you to not only save the form submissions to the database, but view them in the admin panel. You can also export the collected form submission data as XLS, CSV and so forth.
For more advanced functionality, CF7 also provides a lot of PHP hooks/filters you can use to manipulate data before, during and after form submission - check the CF7 Docs for details.
Upvotes: 1