AVAILABLE AS OF RELEASE 2.1
WARNING: Only use this short code to capture data from a form that is NOT created by Contact Form 7 (CF7), Fast Secure Contact Form (FSCF) or JetPack form. If you are using one of those, then this plugin will automatically capture the form submissions. This short code is for special cases.
This plugin was written to capture data from Contact Form 7 (CF7), Fast Secure Contact Form (FSCF) and JetPack forms but what if you don’t want to use them? What if you want to put an old-fashion HTML FORM tag in your post or page and have it submit to a post or page where the data will be put in the database? You may want to do this if you are trying to do some fancy things on the form’s target page that you just can’t do with CF7 or FSCF.
In that case you can use this shortcode on the page that a form posts to to make it save the submission data to the database. This short code does not generate any output on the page where it is placed.
How to do this:
First: Create a form on a page or post. Example
<form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="form_title" value="People"/> First Name: <input type="text" name="fname" value=""/><br/> Last Name: <input type="text" name="lname" value=""/><br/> <input type="file" name="upload"/> <br/> <input type="submit" /> </form>
- In this example, action=”” making the form post to the same page. You can make it the same or a different page as you like.
- You must use method=”post” and not method=”get”
- Give the form a hidden field named “form_title” . This will be used to give the form a name in the database. If not given, the name ‘Untitled’ is used.
- Do NOT name any input fields as “name” like this: <input type=”text” name=”name”/> because WordPress uses “name” and you will navigate to a WordPress error page.
Second, somewhere on the page where this form posts (action page) simply put the short code:
- The short code will save the data to the database
- No page output is generated (but you may get an extra new line if you have the short code on its own line, WordPress can inject a new line)