For those of us who use WordPress, Mike Cherim over at Green-Beast.com has volunteered a ton of time to create a fantastic, secure, and accessible contact form in PHP. The latest and most updated and secure version of this form is available as a standalone script that doesn’t work for WordPress, but is currently under development as a plugin.
However, being impatient and wanting to put this great program to use, I set out to figure out a way to make it work on this WordPress site — after quite a bit of frustration, I did manage to get it figured out, and I’m sharing it here in case there is anyone else out there who is impatient like me and wants to use Mike’s great script!
To make gbcf-v3 work, first create a page template.
Next, copy the gbcf-v3 folder from the download file over at Mike’s site to your site’s template directory (i.e. wp-content/themes/mytheme/gbcf-v3).
You’ll need to edit two lines in form.php and two lines in functions.php, which are included in the gbcf downloaded folder.
In gbcf-v3/form.php, change the $set_directory variable to the full context of your WordPress theme (i.e. wp-content/themes/mytheme/gbcf-v3, instead of the default value of gbcf-v3). Then, scroll down to the top of the form HTML code, and find the <input> tag for setting the name=”name” field. You’ll need to change this to something other than “name” because WordPress already uses this for a value by default — something like name=”gbcf-name” will work!
In gbcf-v3/files/functions.php, change the $set_directory variable to the full context of your WordPress theme (i.e. wp-content/themes/mytheme/gbcf-v3, instead of the default value of gbcf-v3). Then scroll way down to the section where the POST variables are set, and find the one called $_POST['name'] and change it to something like $_POST['gbcf-name'] (or whatever you chose in the form.php file).
Once you’ve saved these changes to those two files, you can then edit the CONFIG.php file as Mike describes in his documentation. To load the contact form on a page, just include the form in your page template, like this: <?php include(’gbcf-v3/form.php’); ?> — that’s it! Upload your new page template, create a new page using that page template and give it a whirl!
You can see the form in action here on our contact page.











Subscribe to Updates
[...] more here: Green Beast Contact Form gbcf-v3 in a WordPress Page Template Related ArticlesBookmarksTags Main Page WordPress Codex (macintosh) WordPress - Wikipedia, [...]