New Contact Form Support Post
If you need support for my version 2.0, 2.0WP, or GBCF-v3 contact form scripts, this is the place to get it. The new place. I’ve used the same blog posts for contact form support comments and questions for such a long time, their pages have gotten long. Really long! I decided to start a new one and just close those. That said, those old posts have not stopped living their useful lives. Many of your questions may already be answered there, read them first.
Support Update: New contact form plugin version 2.1 (for WordPress v3.0+) is now available and better than ever thanks to Mike Jolley. Sorry to those inconvenienced by the wait for a revised edition. This will be worth the wait, though.
Please check out these old support posts first:
- Support Post for Version 2.0
- Support Post for Version 2.0WP (WordPress)
- Support Post for GBCF-v3 (Model SASU)
Before you post, here’s some important info:
- Please identify which script you’re seeking support for. Include the build number as well. If WordPress-related, please be sure to include your WP version as well.
- Comments to this post are only for support of the aforementioned form scripts. Not for other people’s form scripts. If you need help with theirs, ask them.
- I won’t offer much help in the way of styling or customization support. This post is mostly for installation and configuration help, and for your comments and/or suggestions.
- If you need to post code, please wrap your code in
<code></code>
tags, and be sure to convert less-than and greater-than symbols as follows: If you want<
write<
and if you want>
write>
— if you don’t do this, your code won’t post.
Okay, ’nuff said… what’s on your mind?
NOTE: Nov. 2011: Please read update.
Gill responds:
Posted: February 24th, 2009 at 7:35 am →
Before all the questions start hitting the page I wanted to say the form is an absolute Godsend Mike. I use it on a number of sites and it’s slick and spam free. You’re my Hero!
Mike Cherim responds:
Posted: February 24th, 2009 at 9:00 am →
My absolute favorite kind of support request — Thanks Gill
Alex responds:
Posted: February 27th, 2009 at 1:27 pm →
Hi Mike,
Absolutely fantastic form. Really easy to use, implement and customise. A Godsend as the previous poster says!
I do have a question though - I’ve set the form up as instructed but for some reason the email message gets sent to the inputted email address all the time and not to the intended address.
It would be like this message getting emailed to the address I’ve put in rather than posted here. Any ideas?
Thanks,
Alex
Mike Cherim responds:
Posted: February 27th, 2009 at 1:47 pm →
What version are you using Alex? That aside, I can’t see a reason why that would happen (or could happen for that matter). Can you explain more perhaps?
Alex responds:
Posted: March 2nd, 2009 at 12:03 pm →
Hi Mike,
Have a look at www.hydroslave.comoj.com - the testing site I’m using. Whatever address you fill in in the email field the message will be sent to - not the address in the config file.
I’m using the latest version.
Thanks,
Alex
Mike Cherim responds:
Posted: March 2nd, 2009 at 10:44 pm →
I tried it out Alex and never got the email. I assume you did. If not, try a fresh install. It appear you may have done some editing though I have no idea it’d be related, but what you’re stating is basically impossible to just happen on it’s own so I’m thinking something happened during editing. A fresh install would confirm.
Olga responds:
Posted: March 10th, 2009 at 12:46 am →
HI!
I am trying to use your contact form, but my web host doesn’t allow me to upload any language files. It says that these fyle types are not supported. Does it mean I can’t use your program at all? I am trying to use ver3.
Thank you
Jose Gonzalez responds:
Posted: March 10th, 2009 at 6:32 am →
Hi Mike and everybody else,
I’m using Version 2 for WP and I just have 2 questions:
1. To enter 2 e-mail addresses in the forms config, do I separate the e-mails with a comma or a semi-colon? Spaces needed? I couldn’t find this in the documentation.
2. When I submit something via the form, the output screen reads:
Results: Success! Mail Sent!
Message Sent: You have successfully sent a message to me, Jose Gonzalez…
I’d like to change the name as the form is on somebody else’s website. I’m the only registered user (admin) as the owner does not log in at all. Where can I change the name?
Many thanks for your time and well done for the best form out there… BY FAR!!!
Jose
Mike Cherim responds:
Posted: March 10th, 2009 at 7:46 am →
@Olga: Hmm, that’s weird. Can you upload them via FTP? I’m guessing you’re using some server upload feature and it’s balking that they’re just plain old files/dat files. FTP shouldn’t complain.
@Jose: 1) Just a comma, though I guess a space wouldn’t hurt. 2) The output name will match the name you inputted. So if you said your name was Joe Test, the message wold say that. Make sense?
Jose Gonzalez responds:
Posted: March 10th, 2009 at 7:57 am →
Hi Mike,
I see - the form is talking to the sender… (duh… my bad).
Mike: thanks for the quick response!
Jose
Olga responds:
Posted: March 11th, 2009 at 11:54 am →
Thanks so much Mike! You were right on target. Ftp has worked perfectly!
Appreciate it!
Bill responds:
Posted: March 11th, 2009 at 11:39 pm →
Thanks for creating and sharing this.
Please check out my validation page noted above.
The only reason you can see this is becuase I changes this (in function.php)
[Code removed to save space]
to this[Code removed to save space]
None of the variables show up. I beleive that all I need to do is go through each file and set it up with the correct number of “
../
” directory indicators? True?Is there an easier way of doing this?
Mike Cherim responds:
Posted: March 12th, 2009 at 12:12 am →
It says there’s a parse error at the top of your page. Apparently you did some editing, and make a mistake:
Parse error: parse error in [...] /gbcf-v3/files/functions.php on line 295
.I don’t understand why you’re editing the files. I don’t support customizations, but I’m curious to what you’re doing.
Bill responds:
Posted: March 12th, 2009 at 8:29 am →
Thanks for the reply.
The only change that I made is noted in the previous post. I just uploaded the unedited version. Please take a look and let me know what you suggest.
Thank you.
Mike Cherim responds:
Posted: March 12th, 2009 at 8:51 am →
I have no idea. I’ve never seen anything like this. You’re getting an error on a functions that is defined if the files are seen and the thing is installed right. For some reason it seems your path to the files is completely broken or something weird. If you haven’t done a complete install from scratch I would, and if you did, I would ask your host for help as they might be the most likely to know your file structure. Short of installing it for you I’m at a loss.
Bill responds:
Posted: March 12th, 2009 at 10:44 am →
Thanks for reply.
OK, I contacted support and they told me that the server this is hosted on has an older version of PHP. They are going to upgrade the account to a new server with the newest version of PHP.
I’ve installed this on my domain and my churches domain without any problems so this was puzzling to me as well. Now we know.
Thanks & Be Blessed!
Mike Cherim responds:
Posted: March 12th, 2009 at 11:26 am →
Wow, they must have been running PHP 3 since I know the script will work on 4. Thanks for the update, Bill.
Gustaf responds:
Posted: March 21st, 2009 at 2:49 pm →
Hi,
Great script, I just had a question - is there any way to make an attachment of a file before sending the form?
Thanks!
Mike Cherim responds:
Posted: March 21st, 2009 at 8:25 pm →
Hi Gustaf. I tried once to make that an option and was able to figure it all out, except the header. I could not wrap my brain around that. It would be a cool option though, I agree.
ANANDRAJ G responds:
Posted: March 22nd, 2009 at 12:41 am →
Hi Mike,
Absolutely it is really fantastic one. Really easy to use, implement and customise. A Godsend as the previous poster says!
It is reallt great to see such Blogs with good contents. I am eager to have more from u.
Thanks,
Anand
Anmari responds:
Posted: March 23rd, 2009 at 2:53 am →
Wonderful form - thank you
However, It is not listing the themes in the styling page.
I have not “fiddled” or edited, have simply loaded.
I do have my wp-content folder separate from my wordpress folder - see editing wp-config.php or “giving wordpress it’s own directory” at wordpress.org - perhaps that is causing the problem, you may need to change the location called in the plugin.
Anmari responds:
Posted: March 23rd, 2009 at 4:54 am →
Me again - I think you need to use WP_PLUGIN_URL or WP_PLUGIN_DIR, instead of assuming that the wp-content folder is where it normally is. See
http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
It looks like the following Lines may be affected :
line 58 and 60
line 173
line 213
line 279
line 301
line 377
Anmari responds:
Posted: March 23rd, 2009 at 5:24 am →
Okay - I have fixed the code and it seems to be happy now (except it does not like the default permalinks “?page_id=99″, but just gives warning, still works okay .
If you’d like me to send the code with the plugin_url and plugin_dir, please email me.
Thanks for a great job!
Mike Cherim responds:
Posted: March 23rd, 2009 at 8:31 am →
Thank Anmari. Glad you figured it out. That is on our fix list for v3 which is in the works. v3 for WP will be quite different.
Marcel responds:
Posted: March 25th, 2009 at 11:37 am →
Hi Mike, I’ve installed your nice contact form. test-form.php works, validate.php is all green, but I get a weird form. Screenshot: http://www.bootsman.org/contact.jpg
Can you help me pint in the right direction? It looks like all the used variables are empty…
Mike Cherim responds:
Posted: March 25th, 2009 at 12:22 pm →
For some reason or another it seems there’s a lost connection to your language file. You’ve included the form correctly, but the form is not grabbing the data. Did you change something, folder name or something. If so that would do it unless you follow all the steps for changing the folder name. You say the validation has the green bar and its variables? The test form works? How do you have it installed, can you describe the tree so to speak, starting from the domain root. Maybe I’ll see something it that that’s amiss.
Marcel responds:
Posted: March 25th, 2009 at 12:59 pm →
Whoops, delete that previous comment
The tree:
/ < -- document root
/gbcf-v3/
/gbcf-v3/files
I don’t understand why the test-form works, and including it in my page doesn’t.
Mike Cherim responds:
Posted: March 25th, 2009 at 1:11 pm →
Neither do I. Maybe you should contact me via my form and give me a link to the validation page, etc. I’ll look into it a bit.
Paul responds:
Posted: March 29th, 2009 at 2:41 pm →
Hello Mike, great script, exactly what I was looking for, however I’m having a problem. I’m using GBCF-v3 on GoDaddy Linux PHP5.x enabled account. I get through steps 1-8 with no problems. The validation and form-test files are working as I expect with no issues. Step 9 however is where things go wrong. I created a contact page, followed step 9, but when I view the page, it’s blank. I put the validation and form-test files in the same directory as the contact form and again, exactly as I expect with no issues. There are no entries in my error log. I “feel” like I’ve followed step 9 correctly, but I’m relatively new to this. I used notepad to edit the config file, filezilla to ftp to server and Dreamweaver to update my HTML. I suspect something with the HTML, but can’t seem to pinpoint why it’s not working. Any ideas or suggestions?
Paul
www.familyfanclub.net
Mike Cherim responds:
Posted: March 29th, 2009 at 3:36 pm →
Hi Paul. You have the PHP include visible in your source code. My guess is PHP isn’t being executed on your HTML page. You can enable that on your server, or change the page to contact.php. If you do the latter be sure to upgrade your navigation. This subject is in the FAQs.
Dee responds:
Posted: March 30th, 2009 at 1:23 am →
I love this script!!!! Thank you so much!!!! I have one issue. I’m getting more than one copy of an email. I have this script in its own folder in more than one location, and am only having an issue with one of the locations. How do I fix this?
Thanks Mike
Mike Cherim responds:
Posted: March 30th, 2009 at 1:52 am →
I have no idea Dee. I don’t even know what version you are talking about.
Paul responds:
Posted: March 30th, 2009 at 12:13 pm →
Thanks Mike. I didn’t mention it, but I had tried .php per the FAQs and that didn’t work either. I also tried adding an .htaccess file per other comments/problems.
The solution was twofold: You can’t put fully qualified URL in php include statement, this doesn’t work: , this does: Second, as others have said, Go Daddy sucks. I had to add .htaccess file to enable .php within .html. Once I figured out the URL problem, I went back to the .htaccess solution and it worked.
Mike Cherim responds:
Posted: March 30th, 2009 at 12:54 pm →
Cool. Yeah I should have mentioned that you should use a relative URL in the include only, since I saw you had an absolute URL in there.
Kevin responds:
Posted: March 31st, 2009 at 8:57 am →
Hello Mike,
I am using GBCF-v3 on a static site. Form Version: v3 - Build Number: B3.20090130.01 - Model Number: SASU
My validation file: http://emadvisorycorp.com/validation.php
For the options array, I want end users to be able to select more than one item by holding down the Ctrl key.
I have it half-working. In form.php I changed id= to multiple id= and that shows all of my options and allows the user to select more than one. However, only one of the options is sent in the email.
You can see the live form here:
http://emadvisorycorp.com/contact-us.php
I appreciate your help.
Thanks,
Kevin
Mike Cherim responds:
Posted: March 31st, 2009 at 9:32 am →
That sounds neat, but I don’t know how you’d convey that to the output in the email. I guess it’d have to be a foreach, scripted to output neatly. Typically for something like that you wouldn’t use a select element. You’d use checkboxes I think. Maybe radio buttons but I’d have to look into it.
Kevin responds:
Posted: March 31st, 2009 at 9:43 am →
Yeah, checkboxes allow a multiple selection. Radio buttons are typically for choosing just one option.
Mike Cherim responds:
Posted: March 31st, 2009 at 9:50 am →
I’d use that then, I guess.
Paul responds:
Posted: April 1st, 2009 at 3:05 pm →
Hi Mike,
Thanks very much for this contact form! However I am having some problems. I get a success when using the contact form but no mails are sent. I looked in my server error log and i get the following error messages: (ip address edited, plus the domain name)
[Wed Apr 01 19:43:49 2009] [error] [client 100.100.100.100] PHP Warning: mail() [<a href='function.mail' rel="nofollow">function.mail</a>]: SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /var/www/vhosts/mydomain.co.uk/httpdocs/gbcf-v3/files/functions.php on line 1145, referer: [...]
Have you any ideas how i can fix this?
Best Regards
Mike Cherim responds:
Posted: April 1st, 2009 at 5:12 pm →
Looks like your host doesn’t allow the
mail()
function with Safe Mode in effect. I think you have to ask them.Jeremy responds:
Posted: April 2nd, 2009 at 3:23 am →
Thanks! This is a grrreatt and easy to use contact form for our wordpress site. It was so easy to set up and no fuss. Awesome!!!
Paul responds:
Posted: April 2nd, 2009 at 12:21 pm →
Hi,
I turned off safe mode and it is now working, thanks.
Have other users managed to use the contact form with safe_mode enabled? I did some googling and it appears that by default the mail() function will not work with safe_mode switched on.
Cheers
Mike Cherim responds:
Posted: April 2nd, 2009 at 1:14 pm →
Not that I know of, Paul. Thanks for the update.
Bill responds:
Posted: April 6th, 2009 at 5:02 pm →
I would like the font face, size and color to be the same as what’s on my website. I though I read about somewhere in your documentation but can’t find it. Is there an easy way to do it.
Mike Cherim responds:
Posted: April 6th, 2009 at 5:24 pm →
Remove the font-family stuff in the form’s style sheet and your site’s style sheet should take over. Either that or specify the font it’s supposed to be in the form’s style sheet, but that shouldn’t be necessary.
Bill responds:
Posted: April 9th, 2009 at 10:01 am →
Thanks for the reply.
I assume that it uses the default.css but when I make changes it makes no difference.
Mike Cherim responds:
Posted: April 9th, 2009 at 11:05 am →
As far as if the form uses the default.css, I would guess so. You didn’t tell me what script you’re even using so it makes helping more difficult (please refer to the instructions in this post). If you removed all the font-family face specifics from the style sheet being used with the form and you still have those styles showing up, then they must be declared elsewhere. I wouldn’t know where, though. Inspect your site’s style sheet to start. Either that or you have the old styles cached. Clear your cache then f5.
Bill responds:
Posted: April 9th, 2009 at 11:36 am →
Thanks for the reply. Sorry I didn’t include the version. It’s GBCF-v3. You can see what I get at the link included.
I know enough css and php to be dangerous. I am a quick study and can figure things out pretty quickly but this has me stumped. I know I must be missing something. It’s a fresh install of the script and the only changes I made were to the config file, as suggested. I don’t see any references to the .css files in anywhere and I haven’t added them. I’ve used this script on a couple other websites and in each instance it adopted the formatting from my existing style sheets.
Now one thing I noticed, is the way that the style sheet is referenced in my html.
@import "style.css";
Typicaly I will use this reference:
I don’t know what difference this makes but in the site that I refernce it the second way it works fine.
Thanks,
Let me know what you think.
Bill responds:
Posted: April 9th, 2009 at 11:40 am →
Sorry forgot to enter the code correctly. Here it is.
<style type="text/css">
@import "style.css";
</style>
<link href="style.css" rel="stylesheet" type="text/css" />
Mike Cherim responds:
Posted: April 9th, 2009 at 12:49 pm →
It shouldn’t make a difference unless it’s a very old browser that doesn’t recognize import. The order in which you call your style sheets does make a difference (a later called one will override one called earlier when and if they declare styles for the same elements, classes, etc.). On your site you declare these styles:
font-family: arial, helvetica, sans-serif;
and that’s what it looks like for the form, but you have no size declared so what you see it Arial, black, default size. You need to declare the size. I didn’t see that you had the form style sheet called for at all. If you want, put the form styles in your main style sheet, then tweak as needed.Marc responds:
Posted: April 10th, 2009 at 9:58 am →
I was just wondering if I can create some options such as: a array of lets say departments which gives way to the e-mail addresses for that department with the “select all” option or individual e-mail address.
Thanks-
Mike Cherim responds:
Posted: April 10th, 2009 at 10:19 am →
It’s certainly possible. Minus the select all, that’s a feature offered on the commercial version of our WP plugin: 2.0WPM. It is something which will be offered on a commercial version of v3 at some point n the future. Regarding Select all, I think it’s better just to create a general mailbox or All Departments option (sending to a single address that everyone can view, like a mailing list address for example). That’s what we do at Accessites.org.
Vladimir responds:
Posted: April 11th, 2009 at 3:21 pm →
Hi Mike,
Thank you for excellent script which works almost out-of-the-box. Just to advise I am non-technical person in terms of general and more in-depth knowledge of PHP language so a bit of patience is appreciated. May I ask you if this is possible:
1) 1st question. To ensure some fields can be filled with certain characters only ? Let us say I want one field to have URL address only (OK, that is basically no restrictions then) and the other have no URLs or HREF tags etc i.e. number, digits and probably dots. One form I tried has validation option but it can be easily disabled by client if he uses Opera browser and hit “disable script running on this page” and thus form gets emailed unvalidated
2) 2nd question. To restrict amount of characters for each field.
I have figured out the rest of what I need from help so 2 questions only
P.S. I checked posts and could not find similar questions. And if possible please respond in plain English as I am not a technical person and just try to make sure my very simple form of 5 fields to get validated before it’s output is emailed to me.
Appreciated and thank you.
Regards,
Vladimir
Mike Cherim responds:
Posted: April 11th, 2009 at 4:50 pm →
What version are you talking about? As is the form strips HTML, but filtering for URLs only isn’t in the script, I couldn’t see a need. Why do you need that? Regarding your other thing, inputs are limited already (with exception to the Message textarea). In v3 you have the power to adjust the input limits in the config.
Vladimir responds:
Posted: April 11th, 2009 at 7:14 pm →
Thank you Mike,
So in summary:
1. The HTML code gets stripped. OK.
2. I am using version 3 and you say you do not plan to do any “URL” filtering. OK.
3. I have checked the documentation and under “Advanced settings” I see ability to limit number of characters per field (good). This addresses half of my question #2 in previous post.
4. My main question now is how to restrict let us say field “Address” to “letters, numbers and comma” characters only as these are the only valid ones to use there. Similarly ( a bit different validation method though) “email” field should have at least “@” and “.” as the bare minimum. So some kind of restriction and/or validation methods.
Thank you
Regards,
Vladimir
Mike Cherim responds:
Posted: April 11th, 2009 at 8:57 pm →
You can add filtering to try and enforce specific URL formatting only in the website field — if that’s what you’re wanting to do — but I don’t know why it’d matter particularly. That said, you’re welcome to customize the form as much or as little as you like, but it’s not really something I provide support for. I have no intention of adding something like that to the form. There’s a reason for enforcing email formation.
Vladimir responds:
Posted: April 14th, 2009 at 3:05 pm →
Ok, thanks Mike.
After reviewing your answers and digging through config and language files I somehow managed to remove unnessessary fields and fit the script to my needs.
Now the last issue is I have renamed “message” field (at the very bottom) to another mandatory name and wonder how I can limit amount of characters for this specific field. OK, no cumbersome or re-architecturing questions I guess I have asked previously (though they looked common sense requests to me), just limit number of characters in “message” field to let us say “150″
Any idea or specific section to change ? Thank you.
Regards,
Vladimir
Mike Cherim responds:
Posted: April 14th, 2009 at 4:58 pm →
What I would suggest, Vladimir, is to go into the script again and find out where I did the max length stuff and just add one more entry for the message. You will also need to add a maxlength attribute to the textarea in the form itself (assuming you can do that… I’m not sure). If you can’t you need to find a JavaScript solution that will count and limit in addition to the server side. If you do use a JS solution, be sure no note the limit in a noscript element within the textarea’s label so people aren’t caught off guard if they exceed the limit.
For what it’s worth, most emails I get start at 150 characters and some go a lot higher. Not sure of your special purpose for that so I can’t say if 150 is too short, but it sure seems that way. You may want to make the textarea pretty small since a large one won’t be needed.
Vladimir responds:
Posted: April 14th, 2009 at 9:56 pm →
Thank you Mike,
I have managed to limit the field (edited scripts) and form is working almost as I wanted to.
Thank you so much for patience and help Mike.
P.S. I have a few small issues …cannot resize one field (make it taller and wider) but that is more cosmetic, will handle it or leave it as-is.
Best regards,
Vladimir
Mike Cherim responds:
Posted: April 14th, 2009 at 10:32 pm →
Glad to hear it. As far as the unruly input, I’m sure it can be fixed with the style sheet. Keep checking.
George Park responds:
Posted: April 17th, 2009 at 9:33 am →
Hi Mike,
I am using GBCF-v3 and was wondering if it is at all possible to make a field in the optional area a required field.
I am experiencing problems with not being able to reply to emails due to spam blocking and have had problems especially with Hotmail and of course have no other way of contacting the prospective client.
Regards,
George.
Mike Cherim responds:
Posted: April 17th, 2009 at 11:22 am →
You’d have to go into the script and copy the code that makes other fields required and apply it to that field. You’d also want to move the input to a required fields area. I can’t say it’d be easy, but not too hard I don’t think.
George Park responds:
Posted: April 17th, 2009 at 1:07 pm →
Thanks for the reply, but with my knowledge I wouldn’t even know where to start.
Mike Cherim responds:
Posted: April 17th, 2009 at 1:17 pm →
Maybe try the forums at SitePoint.com. All sort of nice helpful folks there that might be able to assist you.
George Park responds:
Posted: April 17th, 2009 at 1:28 pm →
I will, thanks for the link.
Stan Rachwal responds:
Posted: April 22nd, 2009 at 4:04 am →
I just downloaded version 3 of your program which was something been looking for for a while. I tried running your program on my local computer and got an error message that functions PHP could not be found.my first question is do I have to have this program on a host server or can I run it locally. As my website is currently not live it would be hard for me to put it on a host server.I know a little bit about CSS and html but I know nothing about PHP. So any help that you can provide would be greatly appreciated.
best regards,
Stan
Mike Cherim responds:
Posted: April 22nd, 2009 at 5:35 am →
Looks like the path is broken, Stan. This script is only meant to work when buried so deeply in a file structure. Local structures, C:\\, tens to run deeper so the include function isn’t finding the functions file. My advice, put it on the web to set it up. That’s the only real place for it anyway, as designed. Plus, unless you have a mail server it’s not like you can really test anything locally. On the web you can use .htpassword to limit directory access in about one minute, and the form itself can be put in Maintenance mode so you can work on it without others messing about.
Stan Rachwal responds:
Posted: April 22nd, 2009 at 4:10 pm →
hi Mike,
after spending a few hours on the script, I finally got it work.there are two fields that I would like to get rid of. The first is the country and the second would be the optional text.I also need to have all fields required. Can you tell me how I can go about accomplishing this?
PS. Since I travel quite a bit between Pennsylvania and Maine with my photography, maybe we will meet up one day.
best regards,
Stan
Mike Cherim responds:
Posted: April 22nd, 2009 at 4:29 pm →
I suppose to get rid of the country input, you could comment it out. To make all fields required you’d have to re-script a lot of stuff, basically following the methods used for what’s required already. There’s no easy way.
Stan Rachwal responds:
Posted: April 24th, 2009 at 5:17 pm →
hi Mike,
here is my dilemma. I’ve been able to get your test form to work on my site. It returns an e-mail with all the particulars, but when I enter all the information into my contact form, I hit a snag. I fill in all the fields and click submit nothing happens.I know nothing about PHP and would appreciate any help that you can give me. My contact page.
Stan
Mike Cherim responds:
Posted: April 24th, 2009 at 7:21 pm →
Your page didn’t come up, but what you need to do is check your server’s error log to see what it says when you submit it.
Stan Rachwal responds:
Posted: April 25th, 2009 at 3:07 am →
I know I’m being a pest but can you answer one question for me. My script works when action = test-form.php#results, as soon as I replace test-form.php with contact_info.php#results the script stops working. this is the error that I get on a blank page.
Method Not Allowed
The requested method GET is not allowed for the URL /980/contact_info.html.
There are no errors in the error logs.
Mike Cherim responds:
Posted: April 25th, 2009 at 8:13 am →
I have no idea. This is unique. Is there a reason you need to change the action? And there are no GETS in the script that I can think of, only post. I’m confused.
Stan Rachwal responds:
Posted: April 25th, 2009 at 12:49 pm →
I did not change the script. I just replaced test-form.php#results to contact_info.php#results
Stan Rachwal responds:
Posted: April 25th, 2009 at 1:00 pm →
I just tried it again. error log contained this error:
[25-Apr-2009 12:12:39] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/timel13/public_html/980/gbcf-v3/files/CONFIG.php on line 48
Again I did not change anything in the “$subjects = array(” area.
Mike Cherim responds:
Posted: April 25th, 2009 at 2:06 pm →
Check immediately before that then. What precedes it is likely in error. Missing semi-colon, unescaped quote mark in the var, etc. One of those. Regarding the action, you shouldn’t have to edit it normally. The PHP should pick up the page URI by itself. test-form.php is never hard-coded into it so how you “replaced” it is sort of mysterious.
Stan Rachwal responds:
Posted: April 25th, 2009 at 6:46 pm →
Can you check out this error. All the files are where there supposed to be.
contact page
All files where just downloaded. only file that was changed was config.php. Validation works as does test-form.php.
The include line gives me this error regardless where I put it in the .
Mike Cherim responds:
Posted: April 25th, 2009 at 7:15 pm →
I don’t know why you’re getting the error. It looks like you did a lot of customization and I have no idea where you went wrong. As I said when you called me, you needed you include the form into your page, not copy and paste the outputted code. You told me you’d do that right, but now I see you’ve made changes to the fields (incorrectly I must say). I don’t know what to tell your other than get it working first, then modify it. I have to add: I don’t support customizations.
Mateo responds:
Posted: May 3rd, 2009 at 2:28 am →
Hey - I am a huge fan of your plugin and script. However, I am using it within wordpress 2.7.1 (gbcf v3) with a few of the php tweaks to get it to run. When I have permalinks enabled (/%categories%/%postname%) and go to the page, it gives me a 404. However, if I preview it or view it through the normal permalinks (?p=nnn) it works fine. Any suggestions to get it working with the former permalinks? Thanks for any suggestions.
Mike Cherim responds:
Posted: May 3rd, 2009 at 9:25 am →
Did you update your .htaccess file to make use of the permalink structure? That’s all I can think of. I don’t think this has anything to do with the form.
Erik Arckens responds:
Posted: May 12th, 2009 at 9:15 am →
Hi Mike,
this is the best thing since sliced bread!!!
Only issue I have: when I reduce the size of the frames, the footer elements (blocked ip and author name) shift all the way to the left, out of the box. Only solution I found was not to display those. If you have a solution, I will make sure your name comes up on my form box.
Thanks for your GREAT work!
Erik Arckens responds:
Posted: May 12th, 2009 at 9:24 am →
And another question:
I would like to add another optional menu (selection of hours where the sender can be contacted).
Is this something you might consider in the near future for a new version? Or should I do this myself?
If so, how do I best go about?
Thanks!
Erik
Mike Cherim responds:
Posted: May 12th, 2009 at 9:57 am →
Hi Erik. To move those elements to the right you could just increase the left margin or maybe remove the float. As far as adding fields, I don’t really support customization, and I assume you’re talking about v3 it would be quite involved. I can tell you this, you’d have to mirror one of the existing selects changing the variables and whatnot and that would involve a fair amount of customization work.
Erik Arckens responds:
Posted: May 18th, 2009 at 7:59 am →
Hi Mike,
adding another optional menu indeed will require hours of intensive work; I know very little of php but I figured that one out already. Yes, this is about V3. I did a shortcut on this work by changing one of the optional menus to what I want it to be.
Maybe in a future release you would want to consider this extra? (hint hint)
For the rest, only Major praise!!
Mike Cherim responds:
Posted: May 18th, 2009 at 8:39 am →
Hehe, in a way I did… I should have mentioned that. In the documentation I do emphasize that some of those optional fields can be re-purposed or re-assigned to ask for whatever you like. Sounds like that’s what you ended up figuring out. Kudos
ThecounT responds:
Posted: May 21st, 2009 at 1:21 pm →
HI MIKE, I love your plug in and use it on my site above any other like it. Having said that, I have an issue with it since moving server/ hosts. I now get this error:
Fatal error: Cannot access empty property in /data/user/1633576/htdocs/thecount/wp-includes/functions.php on line 452
I’ve look aroud and read a lot about this, I do not share any of the plugins that might cause this, can you please help, I want to contuine to use your plugi.
Thanks!
Mike Cherim responds:
Posted: May 21st, 2009 at 2:54 pm →
Moving host did it? Maybe try deactivating all plugins, then activate the form first, then the others. Other than that I still do not even know what the root cause of that error is. It never happened until WP 2.1 then it started happening occasionally. Not to all, just to some. The why is the unknown though
ThecounT responds:
Posted: May 21st, 2009 at 11:58 pm →
that did not work. do I have any more options?
Mike Cherim responds:
Posted: May 22nd, 2009 at 5:14 am →
I don’t. Sorry.
Derek responds:
Posted: June 9th, 2009 at 1:41 am →
Hey Mike! This is great code. It was referred to me by a friend who uses it on all the websites he develops. The install was quick and easy, and everything validated fine and tests out nicely.
So now, here’s my problem, and this may bo so simple that it’s crazy, but:
I want to include this form within an HTML page I’ve already developed, and I want to use only certain fields from your default test form (such as Name, E-Mail, Phone, Website, and Comments). How do I go about this? Is what I am asking for even possible?
Thanks for any help you can give.
Mike Cherim responds:
Posted: June 9th, 2009 at 2:25 am →
If it’s v3 that’s in the config, except you have to do subject too.
Derek responds:
Posted: June 10th, 2009 at 5:09 am →
Sorry, Mike - you lost me. Yes, I am using v3. I looked at the CONFIG.php file and didn’t find anything that would answer my question. What am I missing here? Am I so brain dead that the answer is painfully simple and I’m glossing right over it? Please point me in the right direction.
Mike Cherim responds:
Posted: June 10th, 2009 at 7:45 am →
Under Form Input Options. There you can turn off the fields you don’t want, at least from the optional ones. This will leave name, email, subject, and comments. See it?
Amber responds:
Posted: June 18th, 2009 at 10:53 am →
Hi Mike,
This form is awesome! Thank you so much for sharing it with us all, I’ve been pulling my hair out trying to create a form with such robust verification. I will try to make a donation soon. I’ve done a bunch of customization to take fields out and change required fields, and the ONE thing that is stumping me is getting the form to send to multiple recipients. I saw above that Jose had asked the same question and you said that adding a comma and space between email addresses should do it, but I can’t get that to work.
Here are the details:
Using v3
In the Config.php file adjusting:
$send_email = "info @ mydomain.com, myname @ domain.com" ; // Your email
Can you see anything that I am doing blatently wrong here? I’ve tried numerous variations and I either break the form, or it only sends to the first email address I put down. Do you have any thoughts on this? I would be so thankful!!
Mike Cherim responds:
Posted: June 18th, 2009 at 12:03 pm →
Hi Amber. I’m not sure. I’ve done it before. Maybe try removing the space after the comma. Maybe that’ll do it. If not, then I’d say to add a second
mail()
function in the script with the data populated manually. If we’re talking about v3 then you’d find that in the functions.php file, nearer to the bottom.Amber responds:
Posted: June 18th, 2009 at 12:13 pm →
Mike, thanks for the very fast reply. I did try removing the space with no luck. I’ll try adding the second mail function as you suggest. Maybe I can get that to work. Thank you very much for your thoughts on this!!!
Amber responds:
Posted: June 18th, 2009 at 12:55 pm →
Just FYI, I did get it to work. It may be the incredibly “hackish” way to do it, but for anyone else who needs it, I added a second $send_email in the config.php file as:
$send_email2 = "myname@domain.com"; // Your email
and in the functions.php file I added a second mail function at line 1137:
mail("$send_email2", "[$web_site] $subject_value",$mail_content,$mail_header,$param);
Three emails were sent (including the cc email), so it seems to get the job done!
Thanks again for your suggestion.
Mike Cherim responds:
Posted: June 18th, 2009 at 1:50 pm →
That’s great. I also think I figured out why it doesn’t work as it does with my v2 form. In v3 I have the email is angle braces so the name appears on the mail from line as it does with most emails. I bet that is what’s messing up email 2. Regarding your added variable, please be sure to sanitize it with my custom
clean_var()
function.Amber responds:
Posted: June 18th, 2009 at 1:54 pm →
Thanks for the tip. I will use the clean_var() function immediately!
George Park responds:
Posted: June 18th, 2009 at 5:27 pm →
Mike,
I have recently upgraded to WP2.8 and since then, my contact page does not work. You can see the page in my url above.
I have uploaded the files, after deleting them of the server, re-activated the plugin, checked all the settings and made sure that the code is in the page and still no fields for the Contact Page.
Any suggestions?
Regards,
George
Mike Cherim responds:
Posted: June 18th, 2009 at 9:59 pm →
I haven’t tried 2.8, but I see the tag on the page. I really have no idea why it wouldn’t be showing. Any PHP errors being recorded on your server? And, that is a Page right, not a Post. Just wondering. That has happened a couple of times.
George Park responds:
Posted: June 19th, 2009 at 4:46 am →
There are no PHP errors being recorded and it is a Page and not a Post.
Been using the form for about a year and it worked great, but since the upgrade from 2.7 to 2.8 the problem has arisen.
Mike Cherim responds:
Posted: June 19th, 2009 at 7:04 am →
I haven’t tested it yet, and I haven’t talked to Mike Jolley yet (he does the WP side of the script) so I’ll have to see. Maybe this is tend of the line with this version. If there are no errors being written to your logs I know even where to begin guessing. Anyone using it on 2.8?
George Park responds:
Posted: June 19th, 2009 at 4:11 pm →
Hopefully Mike will be able to throw some light on this.
Mike Cherim responds:
Posted: June 19th, 2009 at 8:00 pm →
Mike said he’s going to look into it, but did report that he has 2.8 and the form’s working fine. Stay tuned.
George Park responds:
Posted: June 20th, 2009 at 1:08 pm →
If it helps, I can let you have my admin log in for my blog.
Let me know and I will email it to you.
Mike Jolley responds:
Posted: June 21st, 2009 at 9:38 am →
Hi George, Ill gladly take a look for you if you email me at http://blue-anvil.com/contact
Out of interest though, does the page completely stop loading from where the contact form should appear (for instance the footer may be blank or similar). If it does then this may help http://blue-anvil.com/archives/wordpress-28-memory-usage. Just a thought.
Mark responds:
Posted: June 22nd, 2009 at 8:19 am →
Hi I love this contact form it works great there is one small thing that happens and I wonder if you have come across it. I notice that sometimes when people send me a mail it some times cuts them off up to a certain point as if it’s limiting the amount of characters you can have.
Mike Cherim responds:
Posted: June 23rd, 2009 at 8:24 am →
None of the version accept HTML and will strip it out. If people are sending HTML it will sometimes cut off like that, at least the comments part. Is that what’s happening? I hope so because I’ve never heard of any other reason or report of the form doing that. Is there a limit on your mail server (though I’m not sure if that can be limited)?
Mike Jolley responds:
Posted: June 23rd, 2009 at 5:42 pm →
@George Park and others with same problem, if your using the ’share on facebook’ plugin the form will not show; I believe it’s the other plugins fault, not GBCF’s.
Mike Cherim responds:
Posted: June 23rd, 2009 at 6:15 pm →
Thanks for researching it, Mike.
steve responds:
Posted: June 24th, 2009 at 12:56 pm →
Ok-
I got the TESTpage to run but after that I’m officially stuck.
steps 8 and 9 I’m completely puzzled.
if this is my “contact page” html
Fields marked (*) are required
Email From:*
Full Name:*
Comments:*
someone please tell me where to put these lines of code??
9. Add the link to the style sheet and the focus JavaScript file - for form field
focus effects for Internet Explorer - to the head of your contact form page
(see Figure 1), then add the PHP “include” to the body content area of that
same page (see Figure 2). Go live and worry not.
Figure 1 Note: You may choose to add the form styles to your own style sheet or
do something else such as use existing styles. It’s your call. Use the default
style sheet to see what classes you have available to you. The style sheet name
in the example is default.css. Change as needed if using a theme.
P.S. the location of the files is in my root folder
ChristianCourierNewspaper.com/blogbase
thanks for the replies.. Im definately looking forward to using this script.
Mike Cherim responds:
Posted: June 24th, 2009 at 1:30 pm →
Put a link to the style sheet and to the JS file into the head of the page the form will be on. Bear in mind both are optional.
steve responds:
Posted: June 26th, 2009 at 1:37 pm →
OK-
I looked all over the documentation and the stylesheet and config file and I have no idea where to change the
font, font size and and the font size when the user types in
my goal is to be able to have all the fields appear small enough so that it fits on one page without scrolling.
Mike, please tell me EXACTLY in the stylesheet these options are: great script man and thanks for being so patient!!!
Mike Cherim responds:
Posted: June 26th, 2009 at 5:25 pm →
Okay, here’s a freebie. Look for these blocks:
And
See the 1em and 1.1em. That’s the font size. Change as needed or add a font-size declaration to the form div itself. Basic style questions like this probably should be asked at the forums at SitePoint.com. As I have told you and as is written in the FAQs, I only provide basic installation support. For styling and customization you’re on your own.
Steve Anderson responds:
Posted: June 29th, 2009 at 9:30 pm →
Hi Mike,
Your form is awesome, I’ve recommended it to heaps of people. Recently I had a lady try to install it through WP 2.8 as a zipped file but it threw up an error saying there was no header or something like that. I figured I would just get her to unzip the file on her desktop and upload it through her FTP client but for some reason when she extracted it all the files came out separately (ie, not in a folder). I tried this on my PC with the same result…strange. I ended up just downloading the folder from a website of mine and uploading it to hers and that worked but as I recommend your plugin a lot I was wondering why this is happening and is there a way around it.
Thanks,
Steve
Mike Cherim responds:
Posted: July 2nd, 2009 at 7:09 pm →
Hi Steve. I don’t know. I haven’t changed it in a while so it definitely has a folder. What extraction tool did you use? I recommend WinZip.
steve responds:
Posted: July 6th, 2009 at 1:31 pm →
on the contact form…
I figured out to change the text size on the drop down menus, but I want the MAIN headers to change size
like NAME, ADDRESS, CITY, STATE,ETC..
where in the stylesheet do I do this?
Thanks
steve responds:
Posted: July 6th, 2009 at 1:51 pm →
OK- nevermind figured it out
now I’d like to have the fields horizontal instead of all vertical…
like this
Name Zip Code
Email Country
Organization Website
Phone Address Referred By
City/Town Subject
State Message
any ideas on how to do this???
Mike Cherim responds:
Posted: July 6th, 2009 at 2:19 pm →
Take out the breaks. It’s one of the options in the config.
steve responds:
Posted: July 6th, 2009 at 3:28 pm →
thanks Mike but I want just 2 columns
Name-State on the Left
the rest of the fields on the right
i asked for some help on some forums and they told me to setup a div and float it right?
you know the code to copy/paste into the stylesheet?
Mike Cherim responds:
Posted: July 6th, 2009 at 4:35 pm →
Nope. This is not support I’m going to give. I’ve told you before.
steve responds:
Posted: July 7th, 2009 at 11:41 am →
OK-
got everything working just how I wanted it with a little trial and error
now how do I take out those fieldset frames below the SPAM question and the SUBMIT button
thanks
Mike Cherim responds:
Posted: July 7th, 2009 at 12:24 pm →
Config
steve responds:
Posted: July 7th, 2009 at 1:08 pm →
I checked config- i already removed the breaks, now somehow everything got centered???
I removed one of the fieldset borders, but the other one won’t go away
Mike Cherim responds:
Posted: July 7th, 2009 at 2:18 pm →
There’s no reason why removing the breaks would center the form. Try validating. As far as the fieldsets, they’re in the config as I said:
JFK responds:
Posted: July 8th, 2009 at 2:57 pm →
great script, easy to install and quite reliable! …thanks.
just wonder if you consider adding a multiple sender option in a future version … something like:
<select name="send_email">
<option class="selected" value="" >Please Choose</option>
<option value="dummy1@domain1.com">dummy1</option>
<option value="dummy2@domain2.com">dummy2</option>
<option value="dummy3@domain3.com">dummy3</option>
</select>
so the form will be send (only) to the contact selected by the user rather than a static address or group of addresses separated by commas (or else like in Amber’s solution)
jfk
Mike Cherim responds:
Posted: July 8th, 2009 at 4:29 pm →
Like this one? If you are talking about the WP version, there is a commercial version for $70 that offers that option ($50 to GAWDS and WSG members). That’s what you saw if you followed the link — though that one has additional customizations. If you’re talking about GBCF-v3, I do intend to add that at some point to a commercial version, perhaps only for the v3 WP plugin… I’m not sure. Please bear in mind, you cannot add the email to the value attributes as you did in your example for the simple reason that they could then be scraped by ‘bots. Just an FYI.
JFK responds:
Posted: July 8th, 2009 at 4:54 pm →
thanks for such quick answer.
your link shows exactly what I meant.
of course my example would be scraped by bots (thanks for the heads up) but normally I would use it (in a normal html form) when addresses are obfuscated with the help of javascript; it was just the example of how to send the form to a specific destination address.
I am needing a solution like this for a hand coded web page (no WP) and I guess I have either to customize your script (if I am legally allowed to do that …. keeping the credits I guess) or to come up with something else.
what I love the most of your script is the human input validation (CAPTCHA-text?) and this is why I would like to try to customize this script first before moving somewhere else.
thanks again
Mike Cherim responds:
Posted: July 8th, 2009 at 6:23 pm →
You are certainly welcome to customize it to your heart’s content and the credit line is optional (option in the config). The only downside to customizing is if I come up with an upgrade it may make it difficult to use it. That said, it is a really solid script and most of its bugs are fleshed out so once it’s set up and working, and upgrade probably won’t be needed. Some still depends on server config and such. On my servers it runs flawlessly, all options work, and it mails perfectly with zero ‘bot-generated spam (none in years now even on my test forms).
One big advantage you have to doing this yourself as a one-off customization is it makes it a LOT easier because all of the possible variables I have to deal with making it for everyone become known variables for you. Good luck.
Tarleton responds:
Posted: July 18th, 2009 at 11:59 pm →
Hi. Using your form on a site I am currently working on. http://spacioushost.com/cliff/?p=reserve but when you click submit it doesn’t send all the information:
First Name: Joe
Last Name: Blogs
Email Address: joe@blogs.com
Telephone Number: 111111111
Date of Reservation: 25 / / 2021
Time of Reservation: 10:6 pm
Number of People: 18 People
Special Requests:
As you can see it doesn’t send the Special Requests nor does it send the month. Any help apppreicated.
Mike Cherim responds:
Posted: July 20th, 2009 at 2:08 am →
I don’t support customizations.
Erik responds:
Posted: August 12th, 2009 at 8:08 am →
Form Version: v3 - Build Number: B3.20081118.01 - Model Number: SASU
I’m on a GoDaddy Windows server and was getting several errors after form submission saying:
mail() [function.mail]: SMTP server response: 451 See pobox.com/~djb/docs/smtplf.html. in path_to_php_file on line #…
I searched and found this site and its commenters that told me to replace \n with \r\n. I searched my function.php file and simply did a Replace All on \n to \r\n and now my form works perfectly (I think).
Was the Replace All an okay thing to do? Is this an error others are getting?
Mike Cherim responds:
Posted: August 12th, 2009 at 8:32 am →
If it’s working I can’t see any harm to it. Then again, I have no idea why that’d fix it (but I do have to check my list of notes regarding little issues like this). Thanks for the update.
James responds:
Posted: August 17th, 2009 at 9:13 am →
Hi, Could you tell me what the various error codes in error-log.txt mean? The form seems to be working fine, but I notice that the code in the error-log.txt file seems to swap around between 1190 and 1230. I can’t find any documentation as to what either of these mean. Help!
Mike Cherim responds:
Posted: August 17th, 2009 at 9:51 am →
The number is simply a standing count of times one of the form’s traps has been tripped. 1190 means it has blocked 1190 attempts, same with 1230. That number will continue to grow until it maxes out and resets itself.
STEVE responds:
Posted: August 17th, 2009 at 1:42 pm →
Great form Mike!
I have a question though, I would like a customer to be able to upload a file AND fill out their information in the same form.
Then once they upload a file, it shows the name of the file they upload in the email.
make any sense? how would i go about doing this?
Mike Cherim responds:
Posted: August 17th, 2009 at 2:31 pm →
Thanks Steve, and what you’re asking makes sense, but it’s not something I could tell you how to do. Perhaps try the forums at SitePoint.com.
STEVE responds:
Posted: August 17th, 2009 at 3:39 pm →
did that,
one more quick question.. i want the user to be able to upload pdf files as well, which file do i change this in?
Mike Cherim responds:
Posted: August 17th, 2009 at 4:28 pm →
That would depend on what version of my form you’re using.
STEVE responds:
Posted: August 17th, 2009 at 4:29 pm →
v3
Mike Cherim responds:
Posted: August 17th, 2009 at 5:15 pm →
That’d be done in the functions.php file then, plus changes would have to be made to form.php. You could take it further and update the language file and go that route, but there’d be no real need to do that for a single install. Plus avoiding that stuff would make it a lot simpler.
George Smith responds:
Posted: August 18th, 2009 at 3:10 am →
Hi,
Mike - This is a brilliant form, thank you!
My query is this:
Has anyone got it to work in Safe Mode, or, do you plan on making a version to run when PHP Safe Mode is on?
Thanks.
Mike Cherim responds:
Posted: August 18th, 2009 at 6:29 am →
I’d first have to learn what Safe Mode breaks, then decide.
STEVE responds:
Posted: August 19th, 2009 at 8:38 am →
Mike-
how would I change the title of a field, for example, instead of ZIP CODE I want it to say FILE NAME how/is this even possible?
thank you
Mike Cherim responds:
Posted: August 19th, 2009 at 9:02 am →
Language file, Steve. Please read the documentation that goes with it.
George Smith responds:
Posted: August 19th, 2009 at 5:31 pm →
Hi Mike!
Thank you for responding, it wasn’t a personal request for you, just wanted to know if anyone out there that has fiddled with the code has managed to get it to work.
However, I am very glad you have taken an interest
With SAFE MODE ON in PHP it turns off the 5th variable in the mail function:
SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /var/www/vhosts/mydomain.co.uk/httpdocs/gbcf-v3/files/functions.php on line 1145, referer: […]
and if you have the option to send the message back to the user as well:
SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /var/www/vhosts/mydomain.co.uk/httpdocs/gbcf-v3/files/functions.php on line 1154, referer: […]
this relates to this line in the code:
mail(”$send_email”,”[$web_site] $subject_value”,$mail_content,$mail_header,$param);
and
mail(”$email_value”,”[$cc_cc_text] $subject_value”,$cc_mail_content,$cc_mail_header,$param);
respectively.
I assume it relates to “$param”
I tried to follow it through the functions.php but as I don’t really understand how the mail function works in the first place I thought I would ask first to see if anyone came up with a solution already.
If there is a possibility of having the form work with SAFE MODE ON then I’d be very happy.
I’ve had to resort to a lesser form now and it’s just not the same.
Mike Cherim responds:
Posted: August 19th, 2009 at 6:04 pm →
Since you’ve dug that far you could remove the
$param
variable and see if it works. I have it so the value of that variable can be blank, if the -f parameter in the config is off, but maybe it doesn’t like it being there at all. I can work around that I suppose, but damn, what a pain it is keeping up with all there is to keep up with!Let me know if that works, if not it may be something in the mail header (actually the fifth var within the mail function is email is counted). Thanks.
George Smith responds:
Posted: August 20th, 2009 at 6:04 pm →
Hi Mike,
Yeah, I guess I should have tried that, thinking about it, it seemed like the only place
$param
was used was for the switches.Anyway, just to report, it worked
If anyone else runs into the problem of SAFE MODE ON on your server and not being able to change it the following should work:
Change the following in functions.php on lines 1145 & 1154:
mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header,$param);
to
mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header);
(You are basically removing the following text “,$param“)
I think this also mean that the following in CONFIG.php as to be at it’s default value (included below):
$neg_f_param = "yes"; // Or "no" (if needed)
$smtp_sneak = "no"; // Or "yes" (if needed)
$ini_set = "no"; // Or "yes" (if needed)
Hope that helps anyone else.
George Smith responds:
Posted: August 20th, 2009 at 6:09 pm →
Apologies, the following bit is slightly incorrect, Mike can you ammend?
Change the following in functions.php on lines 1145 & 1154:
mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header,$param);
to
mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header);
SHOULD SAY:
Change the following in functions.php on line 1145:
mail("$send_email","[$web_site] $subject_value",$mail_content,$mail_header,$param);
to
mail("$send_email","[$web_site] $subject_value",$mail_content,$mail_header);
&
line 1154:mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header,$param);
to
mail("$email_value","[$cc_cc_text] $subject_value",$cc_mail_content,$cc_mail_header);
Mike Cherim responds:
Posted: August 20th, 2009 at 7:11 pm →
Thanks George. I guess what I’ll have to do eventually is detect safe mode and provide a second set of
mail()
functions for those users. If I do it that way nobody will have to think about it. It’ll just happen automatically. Again, thank you. I appreciate you taking the time and helping out.Edward responds:
Posted: August 27th, 2009 at 10:08 am →
Thank for the great work you do for Wordpress users.
James T responds:
Posted: August 29th, 2009 at 6:57 am →
Hi Mike,
I am running the latest WP build 2.8.4 and your latest from the plugin repo Version v.2.0WP B20080731
I recently started to get
Results: Whoops! Error Made!
Referrer Missing or Mismatch: It looks like you’re trying to post remotely or you have blocked referrers on your user agent or browser. Using your “Back” button, please go back and try again or use our regular email, [email removed], to circumvent Referrer Mismatch.
I could see you had a fix for this back in 2006 but doesnt apply to this version in 09.
I have tried deactivating all my plugins and the error is still there, I did install a redirect plugin to redirect 404 to a 301
Thanks in advance for any assistance the contact form is http://ewiglobal.eu/contact
James T responds:
Posted: August 29th, 2009 at 7:08 am →
Mike,
I just relaised that I changed my email to google apps and the mail server is external to my web server now. I am hoping that there is a easy fix for it, maybe adding google apps support might be a new feature ?
Funnily enough my formbuilder and other forms work though and dont care about the internal mail server ??? maybe there is something about your contact form that relies on the local mail server….. or maybe thats not related at all …?
Mike Cherim responds:
Posted: August 29th, 2009 at 7:22 am →
The script does point to a local server. As far as referrer mismatch that has always been one of two things: The person has referrers blocked or rgw contact page URL (as seen on your address bar) doesn’t match the Form Page URL in the config.
Ergin responds:
Posted: September 8th, 2009 at 3:30 pm →
My form works perfect accept if some one uses Turkish keyboard. Certain Turkish characters just messes up the writing. It becomes unreadable.
In $char_set = I tried to use ISO 8859-9 as appose to UTF-8 but it did help.
Can anyone PLEASE help me?
Thank you.
Mike Cherim responds:
Posted: September 8th, 2009 at 4:23 pm →
It’s probably because it sends the email as “plain text quotable” which can mess up some other things. I don’t know what options are available, though… maybe text/html if applicable.
Ergin responds:
Posted: September 9th, 2009 at 2:40 am →
Thank you for your answer Mike. There is no option in “CONFIG.php” to change the form to “text/html “.
Where should I look for to try to change these options please?
Thank you.
Mike Cherim responds:
Posted: September 9th, 2009 at 8:09 am →
That would be buried deep within the functions.php file. It’s not something one would normally edit.
Ergin responds:
Posted: September 10th, 2009 at 6:02 am →
Thank you again for your answer Mike.
I quote ” That would be buried deep within the functions.php file “.
Yes I can see that…obviously it is totally beyond my capability to edit this. I would understand fully if you are not able to help me on this issue. But if you can I would be very grateful.
Thank you.
Ergin responds:
Posted: September 11th, 2009 at 3:31 am →
Hi Mike,
I have realized that it’s got nothing to do with your form. The problem is with Office Outlook 2003.
Very sorry to trouble you.
Timo responds:
Posted: September 13th, 2009 at 4:39 pm →
Hey Mike,
First of all, fantastic form. I love it. Best one I’ve come across.
I’ve tried sending a test email but everytime I hit submit, it tells me some referrer error. I looked on your old support posts and must have missed a solution (if any). I have tried what your config file says // at the beginning of the string). Is there anything I can do to fix this?
Mike Cherim responds:
Posted: September 13th, 2009 at 5:27 pm →
What version are you using Timo?
Timo responds:
Posted: September 13th, 2009 at 8:41 pm →
I am using regular 2.0
Mike Cherim responds:
Posted: September 13th, 2009 at 9:52 pm →
In the last section then you need to add the URL of the page your contact form is on under the
$form_location
variable. You don’t really need to comment out the old one (the PHP that’s there), as long as you place the new line after it. I dropped referrer matching with v3. It isn’t needed and could be problematic. I’d suggesting using v3 instead of 2.0.Lisa responds:
Posted: September 21st, 2009 at 5:10 pm →
Hello,
To start. Thanks for this great form plugin. I have used it in the past with great success.
But, I’m developing a Wordpress site and have tried to use the built in themes that come with the form but they are not recognized. I have triple checked the file permissions on the .css files, they are all set to 666 for reading and writing. I have also removed the plugin completely four times and still the style sheets will not recognize.
Any suggestions? I appreciate it.
Lisa responds:
Posted: September 21st, 2009 at 5:25 pm →
Hi again,
I wanted to get back to you asap before you racked your brain about the question of the built in themes not styling my form.
I am custom coding a Wordpress theme based on the Kubrick platform and commented out part of the header.php code for the time being. I thought I’d better check other areas of my theme before I spent more time focusing just on your plugin. This commented out code prevented the style sheets for the form from working. Anyway, problem fixed.
Thanks very much.
Mike Cherim responds:
Posted: September 21st, 2009 at 7:18 pm →
Ah, yes, the
wp_head()
function. Glad you got it sorted.Greg responds:
Posted: September 22nd, 2009 at 9:24 am →
Great form. Up until now no problems. The server I use has a new setting for their spam badmailfrom_list and will not send out email with the envelope_sender as
anonymous@mydomain.com
. Is there a line of code I could add somewhere so the envelope_sender can bemyname@mydomain.com
? Thanks.Mike Cherim responds:
Posted: September 22nd, 2009 at 10:42 am →
First of all, what version are you using?
Greg responds:
Posted: September 22nd, 2009 at 11:00 am →
Oh my, I forgot to mention the version even though I read your instructions.
I’m using v3
Mike Cherim responds:
Posted: September 22nd, 2009 at 11:20 am →
Hi Greg. If I understand the issue correctly, setting the
$smtp_sneak
var might solve the problem. The$neg_f_param
var may also play a role here. Please mess with those a bit to see if that fixes it and let me know.Greg responds:
Posted: September 22nd, 2009 at 1:29 pm →
I followed your instructions and had no luck. This is a managed server at godaddy and they have been changing the way their servers are filtering outgoing emails, one of which is no email with anonymous will go out. I did have luck with a couple of other forms after I added a line like this
putenv('MAILUSER=noreply@mydomainname.com');
But with your form I’m not sure where to put it. What makes this particular is our domain is hosted on this server but our domain email is with google.
Mike Cherim responds:
Posted: September 22nd, 2009 at 1:59 pm →
Hi Greg. In the functions.php file are the two headers (one for normal, one for the copy, if activated). You can find them on lines 700 and on 711 (and the mail functions are on lines 1145 and 1154. I suppose you could hardcode a value in the first strings where I build the headers. Someone else a while ago had issues on GoDaddy, but even after looking in my emails (I save some for “next update” info), I couldn’t see that it was resolved. The person did comment that he tries his best to not let his web hosting clients be hosted by GD for this and other reasons. I have some domain names registered with them, but as far as hosting I don’t know what they do over there so I have no ideas.
I’m sorry you’re having problems. It is probably some simple, silly little thing.
steve responds:
Posted: September 24th, 2009 at 8:16 am →
Hey Mike
I’m using v3 of your contact form.
I would like to be able to change the file formats a user is able to upload
I need them to be able to upload: .mp3 .mp4 .avi .mov .pdf
I checked the en (language file), functions.php, form.php and no luck
where and how do I set these options?
Thanks again
Mike Cherim responds:
Posted: September 24th, 2009 at 8:51 am →
The form doesn’t have any file upload functions to begin with so you can’t add file types. To make that happen you’d have to script in that functionality.
steve responds:
Posted: September 24th, 2009 at 8:58 am →
all set..
thanks Mike
Wendy responds:
Posted: September 26th, 2009 at 2:01 pm →
I’m in the process of installing the Form Version: v3 - Build Number: B3.20090130.01 - Model Number: SASU. I’m delighted with the features of this form, but would like to add a couple of checkboxes for options my viewers might want to request when they contact me (e.g. “Send me info about blahblah” or “Add me to your mailing list”). I don’t see an easy, straightforward or built-in way to do this; nor have I been able to find much reference to this in the comments or help section. I’m only just starting to learn PHP and since this script is quite complex, I don’t want to try to add it myself without having a better idea of what I’m doing. Is there a straightforward way to do this that I’m not aware of? I think I see formatting specifications for checkboxes in the CSS so checkboxes must be used by some people in the form; I’m just not sure how to add them to the script and make sure I don’t mess it up. Any help with this would be most appreciated. Thanks in advance.
Mike Cherim responds:
Posted: September 26th, 2009 at 2:25 pm →
You’re not finding help on adding checkboxes because it’s not an offered option. Based on what you wrote, however, the referral select might be able to be used for that (rename it in the language file), or the subject select, perhaps?
Wendy responds:
Posted: September 26th, 2009 at 3:43 pm →
Hi Mike,
Thanks very much for getting back to me, and so quickly! Yes, I considered using the drop-down menu for this, but sometimes my viewer might want to select more than one option. I could put other options in the subject, but then I’m limited to only two options and there are times when I might want to use more. I’m curious why checkbox fields weren’t offered as options for the form? Are there people available who know your form code who could add checkboxes for me? Thanks.
Mike Cherim responds:
Posted: September 26th, 2009 at 5:38 pm →
I didn’t need them so I didn’t bother adding them. All this work was borne of necessity for me, I just decided to share. I do believe there are a number of people at the forums at SitePoint.com that know the script. You could check there I suppose.
Wendy responds:
Posted: September 26th, 2009 at 5:55 pm →
Thanks Mike! I’ll try there. Thanks for your help, and thanks for sharing your great script.
jfk responds:
Posted: October 22nd, 2009 at 2:33 am →
Hi Mike
I am including your contact form in a client’s website for which they are paying. I didn’t find any related post so I wonder if I am legally authorized to do that.
The contact form is part of the services offered to the client and I am just doing some (css) customization to the script. Thanks in advance.
jfk responds:
Posted: October 22nd, 2009 at 2:52 am →
sorry…. I just read the disclaimer within the form.php; question answered! thanks for your great script.
By the way, I did a script customization in order to have multiple choice of recipient addresses selectable by the visitor like “to contact John, click here or to contact Mary click here” (or anchors on the names) then launch the form and send the message to the specific recipient (I hope I explain myself clearly)
This customization is a php script within the CONFIG.php file (based on other post here) combined with mod_rewrite (for people who has such option in their servers).
Please let me know if you think this solution would be useful for somebody and if this is the right place to share.
thanks again
Mike Cherim responds:
Posted: October 22nd, 2009 at 5:12 am →
Sounds pretty cool, jfk. Another choice is to offer a form select, but what you have sounds like a good plan too.
jfk responds:
Posted: October 22nd, 2009 at 5:52 am →
I know that a form select is available for the WP version but this solution is for the GBCF-v3 that works in any standard web page (when mod_rewrite is available)
Mike Cherim responds:
Posted: October 22nd, 2009 at 6:24 am →
I’m not suggesting another form version, I was just saying you could add that method as another option but what you have sounds good.
Ruth responds:
Posted: October 30th, 2009 at 9:58 am →
Hi,
Great Plug-in! I just wondered if you could get rid of the message or make it optional as people don’t always seem to realise they have to add a message and when they don’t it causes an error!
Any help would be MUCH apprciated…
Thanks
Ruth
Mike Cherim responds:
Posted: October 30th, 2009 at 10:52 am →
You could add some “No message” message, hardcoded in the form, then just comment out the whole thing. That’d be the easy way. But it does beg the question: If you don’t accept a message, what’s the point of having a contact form?
Ruth responds:
Posted: October 30th, 2009 at 11:34 am →
Thanks Mike. I’m not really sure how to do that so any pointers would be amazing! They just want people to register their interest so it would be better if this was optional. Also can you remove the option for them to add their web address?
Thanks so much for you help
Ruth
Mike Cherim responds:
Posted: October 30th, 2009 at 12:43 pm →
Just put fixed in the textarea and comment it out, but if you want it to leave it optional don’t comment it out as it’ll just send with whatever you put there (unless they overwrite it with their own comment). Doing that will mean it doesn’t send empty so it should work just fine allowing some to comment while others leave whatever you put in there. Regarding the optional web address, you can just comment it out, it’s optional. I don’t support customizations, but you can get help with this sort of thing in the forums at sitepoint.com, among other places like it.
Poli responds:
Posted: October 30th, 2009 at 3:15 pm →
Hello Mike,
Thanks for the plugin. I love that it can take as much style as one wants. I’m using v.2.0WP B20080731
What I want now is to put two different forms in the same site on different pages. One with minimun fields and the other with most of them. No problem there. But how can I install two forms? It seems that I can’t install two scripts. Can I? Perhaps there’s another way of doing it. The two forms need to call the same CSS so I only need to be able to edit the structure of the forms and possibly tell them to go to a different email. I just need the two forms to process data independently. I believe v3 allows that by just changing the name of the form. Couldn’t find a similar solution for v2.0WP. Any help will be appreciated.
Thanks Poli
Mike Cherim responds:
Posted: October 30th, 2009 at 3:56 pm →
They can’t unfortunately. Sorry.
Poli responds:
Posted: October 30th, 2009 at 4:46 pm →
Thanks for your reply, Mike. A shame that cannot be done. I got so used to your form that can’t get myself to use another one for the second one.
Poli
James responds:
Posted: November 3rd, 2009 at 11:34 pm →
Hey Mike!
Great contact form! I just had a quick question. Where would I go about removing validation for the Name and Subject fields? I can remove the actual fields, but can’t figure out where to remove the validation. I only want to have an E-mail field, Message field, and the Spam protection field if possible. Thanks!
Mike Cherim responds:
Posted: November 4th, 2009 at 12:27 am →
You could hardcode fixed variables, like N/A or No Subject then comment them out, or just go through the script bit by bit and remove the variables for those so you can remove then inputs.
René Box responds:
Posted: November 11th, 2009 at 7:26 pm →
Hi Mike,
Came across a little error in the form.php script (at least my validator tells me that there are empty span tags.
I had a look at form.php and found that the error is generated by the following line:
'.$required_combo.''; ?>
I’ve changed it to:
The empty span tag error has now gone.
Please not that I’ve never before touched php so I don’t know whether my correction has any detrimental effect but as far as I can tell, everything still works
Maybe you can look into this?
Regards,
René Box
René Box responds:
Posted: November 11th, 2009 at 7:39 pm →
Ok, it look like it is not allowing me to post the lines of code….
Is there any way of posting the code or do I need to email it to you?
Regards,
René Box
Mike Cherim responds:
Posted: November 11th, 2009 at 7:49 pm →
You can write code by changing the angle brackets as shown above [the comment box], and use the code tags (shown above that). It’ll print if you do that. There are absolutely no validation errors whatsoever in the form so I have no idea what you’re seeing. Did you open and save it a non-plain text editor perhaps. Dreamweaver or Word for example. They will screw with PHP and cause errors. Validate from the demo and you should find all it order.
René Box responds:
Posted: November 11th, 2009 at 7:56 pm →
Try again:
This line seems to generate the W3C validation error:
'.$required_combo.''; ?>
Changed it to:
Hope it works this time
No, I used Notepad++…. I am aware that Dreamweaver or word messes with the formatting but the error is in the original form.php ==> line 90
Regards,
René Box
René Box responds:
Posted: November 11th, 2009 at 8:00 pm →
I will get there
From:
<label class="opt-label main-label">'.$required_combo.''; ?>
To:
<label class="opt-label main-label">
René Box
René Box responds:
Posted: November 11th, 2009 at 8:08 pm →
Hmmm…. Try again…..
From:
<label class="opt-label main-label"><?php echo $main_label; echo'<span>'.$required_combo.'</span>'; ?></label><?php echo $add_break; ?>
To:
<label class="opt-label main-label"><?php echo $main_label; ?><?php echo $required_combo; ?></label><?php echo $add_break; ?>
René Box
René Box responds:
Posted: November 11th, 2009 at 8:19 pm →
P.S. I use the HTML validator add-on for Firefox to check for errors on my webpages.
I parsed the php form (form.php) into my existing HTML page and the page it generates when opened on-line shows
<span></span>
i.e. an empty span tag which seems to be generated by line 90 in form.phpRené Box
Mike Cherim responds:
Posted: November 11th, 2009 at 10:09 pm →
I don’t know what to say. I cannot replicate the error myself.
René Box responds:
Posted: November 12th, 2009 at 7:22 am →
Mike,
If you create a new HTML page and put the css and java link in the head, then parse the form.php in the body and open the HTML page once uploaded, look at the source code of the generated page. Around the “Required” label you will see an empty
<span></span>
; tag.René
Mike Cherim responds:
Posted: November 12th, 2009 at 7:57 am →
I know there’s an empty span there, it’s used for styling if the required option is used, but that not invalid. In fact it’s inconsequential. Span is the only element which has zero semantic value. Even DIV has some value in this regard.
René Box responds:
Posted: November 12th, 2009 at 9:01 am →
Ok, thanks for explaining that.
But if the option is not used would my rewrite of the code (second line I posted) to get rid of the empty span tags have any detrimental effect i.e. is the code correct?
As I said, I don’t know anything about coding in php. I just used my imagination
René
René Box responds:
Posted: November 12th, 2009 at 10:04 am →
Hi Mike,
Just had a look at the Nl and Be translations of the language files (they are both identical) and noted that there are quite a few incorrect translations in both files. I am Dutch from origin but live in the U.K.
Would you like me to correct them?
René
Mike Cherim responds:
Posted: November 12th, 2009 at 10:20 am →
You can remove the span and the code in it but you will remove the option to show your required fields differently than the default method. The demo doesn’t use that, but you can see it in use here. The span is a styling hook for that text.
Mike Cherim responds:
Posted: November 12th, 2009 at 11:47 am →
Thanks René. Ordinarily I’d say yes, thank you, but I doubt I’ll be updating the form anytime soon so I wouldn’t bother. Again, though, thank you.
GM responds:
Posted: November 16th, 2009 at 11:20 pm →
Great form, love the implementation and config.
One thing though:
eregi() is depreciated and throws up errors in XAMMP (guess it is using php5). Can this be replaced in functions.php with str_replace()??
Mike Cherim responds:
Posted: November 17th, 2009 at 6:03 am →
ereg() and eregi() I knew where removed from PHP 6, 5 should be okay. Are you using 6 already? I forget what I was going to replace that with. str_replace(), maybe. Try it out I guess.
Kim responds:
Posted: December 1st, 2009 at 6:48 pm →
I usually do a search for the V.2 contact form plug in name via my wp dashboard, and then just click install .. simple. Your plug in isn’t coming up on the search. So I thought .. brilliant I’ll simply search for the authors name .. Mike Cherim … nothing. Beast-Blog…. nothing. So then I think well I’ll download the zip and upload it, no problems. It installs, but I get an error message on the activation saying ‘ no header’ . I come here and it says ‘have you unzipped the zip file?’. Well I’ve never installed a plug in this way so I go back to my desktop, unzip the zip file and try to upload again but it actually says to use the zip file and it won’t choose any of the unzipped folders or files. So here I sit, really really wanting to use your plug in, it looks great and the feedback is excellent, but I’m out of options and ideas. Thought perhaps you might have one or two??
Mike Cherim responds:
Posted: December 1st, 2009 at 7:23 pm →
I don’t know what to say. Unzip the Zip file to get the contents, then upload the wp-gbcf folder onto your server in the WP plugins directory (by way of your server admin or FTP). You should then see the text “Contact Form” in your WP admin’s nav menu (left side now I think). Click on that and you go to the admin pages for the form. Personally I’ve never installed a plugin any way other than by FTP. Does that help, I hope?
Kim responds:
Posted: December 3rd, 2009 at 10:20 pm →
yeah I do it both ways ( as the song goes ~). I’m wondering why it doesn’t come up on the wordpress search and whether that is because it doesn’t have some sort of official name that wordpress can pick up? That’s perhaps called a header? I’ve never had a plugin not show up on the search function before. I want to put it on all my sites so I’m curious about this.
Kim responds:
Posted: December 3rd, 2009 at 10:33 pm →
Okay, so what I did was upload the zip file into the plugin folder using cPanel, and unzip it there, then delete the zip file and that worked. Thanks Mike, I’m looking forward to using it. xxKim
Bernard responds:
Posted: December 20th, 2009 at 11:54 pm →
I’ve followed all the instructions but when i want to incorporate the form in my site i get this error message:
<
Warning: include_once() [function.include-once]: URL file-access is disabled in the server configuration in /home/content/s/c/h/schoolsafemfg/html/contactus.php on line 75
Warning: include_once(http://www.schoolsafemfg/contactform/form.php) [function.include-once]: failed to open stream: no suitable wrapper could be found in /home/content/s/c/h/schoolsafemfg/html/contactus.php on line 75
Warning: include_once() [function.include]: Failed opening 'http://www.schoolsafemfg/contactform/form.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/s/c/h/schoolsafemfg/html/contactus.php on line 75
>
Can you help me?
Mike Cherim responds:
Posted: December 21st, 2009 at 2:37 am →
Looks like that function, include_once(), isn;t supported or something like that — I’m just reading the errors same as you. Maybe your host can help.
Avrohom responds:
Posted: December 29th, 2009 at 2:28 pm →
I am trying to use your powerful looking form in WordPress v 2.9
but I get the error message:
“The plugin does not have a valid header”
I don’t understand the message at the top to unzip the plugin before uploading. On my dashboard for uploading plugins it explicitly says to upload in zip format.
I tried unzipping first — but then their uploader would only take one file at a time — which seems will fail.
I don’t think Wordpress recognizes files uploaded through ftp.
Mike Cherim responds:
Posted: December 29th, 2009 at 3:14 pm →
It does if you put them in the plugins folder. Unzip and put the folder in the plugins folder on your server, then it’ll work.
Andy responds:
Posted: January 19th, 2010 at 10:10 am →
Thank you for your brilliant form - I’m a big fan. I wanted to implement it in a hidden element like the ClearLeft site (this seems fully accessible). My problem is the form is hidden on submit whether or not there are any errors - do I need to adapt the form or the hide/show javascript? Any advice much appreciated.
Mike Cherim responds:
Posted: January 19th, 2010 at 11:00 am →
Thanks Andy. I had to find ClearLeft’s contact form (which was more difficult than I expected since I normally have JS disabled via NoScript until I hit a site and okay it) to see what you mean. It is accessible without JavaScript, but you have to scroll way down and the contact link becomes a lot less *intuitive. Thus my difficulty. I’m sure you could apply something like that without too much trouble. It’s doable. The actual how-to, however, would have to be answered by someone more JS-savvy than myself. I’m sorry. I find the forums at SitePoint.com can be a great resource for form customization help. I send people there all the time.
*To anyone interested, this could be fixed by simply adding the “contact” ID name to the form element (or legend would be okay) so that when one clicks on the link it moves them to the form instead of to the top of the page with no form in sight as it does now when JS is not enabled.
sam responds:
Posted: January 28th, 2010 at 6:21 am →
Hi there Mike
Thanks for sharing your form as a non coding designer its a great find. I juat wanted to ask you a little question… how would I make ther fields go from optional to required?
Many thanks
Sam
Mike Cherim responds:
Posted: January 28th, 2010 at 9:28 am →
That depends on what version you’re using, Sam. You didn’t specify. That said, in any case, it would require custom coding — possibly just copying and pasting the stuff that makes the other fields required.
sam responds:
Posted: January 28th, 2010 at 1:07 pm →
sorry and you did say to mention that as well!!! Its the new version but not the one for Wordpress. I did have a look but was not sure what was making the fields reqd could you point me in the right direction… thanks for prompt reply BTW
sAM
Mike Cherim responds:
Posted: January 28th, 2010 at 1:28 pm →
If it’s GBCF-v3, Sam, modifying that will be rather difficult and involved. I can’t really point you in any direction other than these two options: 1) Look at how the other required fields are handled and make modifications in the script to include the fields you want covered (will not be an easy task, even for those handy with PHP), or; 2) Try hiring a developer to make the mods for you. A place to look for help in both options would be the forums at a place like SitePoint.com. I find that they in particular are a good bunch and very helpful. I send lots of people there since I don’t offer my own customization services. Hope that helps, albeit indirectly.
sam responds:
Posted: January 28th, 2010 at 2:05 pm →
Ok Mike thanks very much will have a look!
Sam
HazMatt responds:
Posted: February 2nd, 2010 at 5:48 pm →
I ran into the same problem as Amber in regards to multiple email addresses in the $send_email variable… it didn’t work with or without the space. The form appeared to process correctly (including the Success! message) but no emails were ever received.
So, I did the fix Amber prescribed along with the clean_var() function:
$send_email2 = clean_var($send_email2);
mail("$send_email2", "[$web_site] $subject_value",$mail_content,$mail_header,$param);
Just thought I’d let y’all know that that works pretty well.
Mike Cherim responds:
Posted: February 2nd, 2010 at 10:28 pm →
Thanks HazMatt. Sorry your comment took a while to be posted. Akismet ate it.
Paul Dollar responds:
Posted: February 11th, 2010 at 1:37 am →
Hi Mike,
Been using your form for a few years now and love it. On my first installation I remember having trouble with a referrer mismatch error on form submit and I was able to correct it (probably more by accident than skill or knowledge) It has, however popped up again on a simple site I did for my Brother’s company two years ago. (jgdollar.com) I have not changed anything in a few months and it just started happening in the last few days. Any thoughts on what might be going on? I have absolutely no idea.
Thanks,
Paul Dollar
Mike Cherim responds:
Posted: February 11th, 2010 at 2:43 am →
The Form Page URL in the config needs to have in it the exact URL of the page your form is on.
Paul Dollar responds:
Posted: February 11th, 2010 at 3:48 pm →
duh… I actually moved the site 6 months ago, I guess we can see now how little traffic it gets as they only noticed it recently Thanks for the quick response and I will be sure to do a little more looking next time.
Paul
Lenamtl responds:
Posted: February 15th, 2010 at 9:45 am →
Hi Mike,
Thanks for your great script.
How come when I received the form message all data is on the same line (no return between fields)
Should I need to add /n to have a better message format.
I have tested into 2 mailbox and this is the same result.
Any clue
Thanks
Mike Cherim responds:
Posted: February 15th, 2010 at 10:27 am →
Not sure. The output strings have one or more newlines for proper formatting already so adding them in shouldn’t do anything different. Maybe try a carriage return instead of newline. Not sure if that’d have any affect, but I guess it’d be easy to try and test.
lenamtl responds:
Posted: February 18th, 2010 at 9:46 pm →
Hi Mike,
Thanks for the suggestion
The carriage Return did the trick
Mike Cherim responds:
Posted: February 18th, 2010 at 10:33 pm →
Cool! Love a happy ending
lenamtl responds:
Posted: February 23rd, 2010 at 10:02 pm →
Hi,
I’m trying to have text label and field on the same line
I know that I can disable
To make a better look, I have tried to add some float in the css but when doing this the form
got a little bit mixup.
So I add a table but I got a parse error…so I have try different way and still having this error.
Any clue?
Is anyone have achieve this or have a better solution?
Thanks
Mike Cherim responds:
Posted: February 23rd, 2010 at 10:36 pm →
Since you can disable breaks I know you must be referring to GBCF-v3. Based on what you wrote it seems you added a table to the form.php to try and put the form in a table so as to organize it better. But you did something wrong and now have a PHP parse error — and there’s no way I could know what it could be unless I had access to your server’s error log. If I got all that right, what I suggest is to delete the form.php you modified and put the original back (download the form again if you need a new copy), then go to the CSS forums on a site like SitePoint.com and ask what CSS entries to add so it looks as you like. I’ll be frank, adding a table was a bad idea on many levels. You shouldn’t have done that. You made your life more difficult unnecessarily. You just need a little CSS help.
lenamtl responds:
Posted: February 24th, 2010 at 1:06 pm →
Yes I’m using GBCF-v3.
Ok I agree with you adding table is not the appropriate solution and using CSS is easier.
I will investigate why adding float cause problem with some dropdown fields.
Thanks for your input.
Karen responds:
Posted: April 18th, 2010 at 9:05 pm →
I’m using gbcf-v3 in PivotX 2.1.0 beta 3. I have two forms on two pages: contact us and free sample. Each one has it’s own folder: gbcf-v3 and freeform. In the header, I have the following:
[[ if $pagetype=="page" ]]
<link rel="stylesheet" type="text/css" href="gbcf-v3/files/themes/gray.css" media="screen" />
<link rel="stylesheet" type="text/css" href="freeform/files/themes/gray.css" media="screen" />
<!--[if IE]>
<script type="text/javascript" src="gbcf-v3/files/focus.js"></script>
<script type="text/javascript" src="freeform/files/focus.js"></script>
<![endif]-->
[[ /if ]]
I don’t think this is right. If you look at the contact us form [http://wordperfectworld.com/?p=contact-form], it’s fine, but the free sample [http://wordperfectworld.com/?p=free-sample] form looks different. It is suppose to be different, but not with the large spacing between fields. I couldn’t get it to cooperate, so I pasted all the css code for contact us into free sample. I figured, if both css are the exact same, then the forms should look the same. It didn’t help. If I change anything in the free sample css, it affects the layout of the contact form.
How can I “separate” the two forms’ style sheets so that one does not affect the other? I’ve posted to the PivotX forum, also, but no replies yet.
Muchas gracias.
K
Karen responds:
Posted: April 19th, 2010 at 12:57 am →
Mike,
I finally had a PivotX response, and it appears that the page editor placed <pre> and <code> tags around the php that calls the form. I removed the tags, and my form is now responding to the css. Whew! I had a feeling it wasn’t a Green Beast problem. Sorry to bother you.
Cheers!
Karen
Mike Cherim responds:
Posted: April 19th, 2010 at 3:01 am →
I love the self-solving
Shawna responds:
Posted: April 21st, 2010 at 8:24 am →
Yesterday my server was upgraded to PHP 5.2 and I installed the W3 Total Cache plugin. I tested my Contact Form and the e-mails never show up. I also do not get the message at the end saying the e-mail was successfully sent. Instead the page just refreshes.
Any help in fixing this problem would be greatly appreciated.
Btw, the contact form was last successfully used on the 4/17
Thank you
Mike Cherim responds:
Posted: April 21st, 2010 at 9:04 am →
I’m not sure. Maybe it’s the PHP version issue or a conflict with that other plugin (I’d try with that disabled). If it’s a PHP version issue, you should see this in your server’s error log. That’s the first place I’d look.
Shawna responds:
Posted: April 21st, 2010 at 12:54 pm →
I re-installed it and it seems to be back to normal now.
:)
Mike Cherim responds:
Posted: April 21st, 2010 at 1:57 pm →
Nice, I’m on a roll.
VH responds:
Posted: April 27th, 2010 at 9:34 pm →
Hi Mike - great form, thanks! (using V3)
One question - I’m trying to add additional fields, and I think I’ve got it alright, but when I add the labels to the language file (using en-us) they don’t show up. I can change the wording of existing items, and the form itself seems to work, so I’m assuming it’s all put together correctly, but if I try to add more labels to the language file and number them subsequently, nothing happens. I’ve made sure to add the variable and the number from the language file to the functions page, but still not working. Is there anywhere else I have to specify it? Thanks!
Mike Cherim responds:
Posted: April 27th, 2010 at 10:20 pm →
You need to add them to the form.php file now (and throughout the functions.php file, such as in the mail string so the inputted content will be delivered). What you’re doing can be complex depending on your PHP comfort level, but it sounds like you’re on your way.
VH responds:
Posted: April 28th, 2010 at 3:55 am →
Thanks - I do have the fields in the form page, and the input box shows up on the webpage, but not the label? I’m thinking maybe I’m not adding them correctly to the language file, but maybe I’m just missing something somewhere else?
VH responds:
Posted: April 28th, 2010 at 5:15 am →
Hi Mike - got it sorted; apparently the list of language to variable assignments and language file are sequentially sensitive; once I made sure both were in the same order (I had them added the label as the next to last item in the language file and the last item in the functions file) the label showed up just fine. Thanks!
Mike Cherim responds:
Posted: April 28th, 2010 at 7:48 am →
Ah, yes, I didn’t know where you were stuck, but the sequence is important as that is how the language file is read. Glad you got it sorted.
VH responds:
Posted: April 28th, 2010 at 5:30 pm →
Hi Mike - alright, I know you don’t do customizations, but if you could point me in the right direction it would help a lot. I’ve got all the additional text fields and message boxes working perfectly, everything else customized just fine, but I need to add radio buttons. I’ve been running around in circles on it - the form looks just fine on the front end but the selected values aren’t making it to the email. Obvious guess is that the values aren’t in the list when the email is getting created, but they are listed with the rest, so I’m thinking I’m missing something a little higher up on the functions file (I did add the values in the same way I did for the text fields, but that may not be correct), or I don’t have it quite right on the form file. Any ideas? Thanks!
Mike Cherim responds:
Posted: April 28th, 2010 at 6:44 pm →
I really don’t have any ideas. I’d have to dig into the script to even have a clue what was or wasn’t done. Sorry. Maybe a forum like SitePoint.com will provide the answers you need.
VH responds:
Posted: April 28th, 2010 at 7:00 pm →
I checked there, and a number of other places already, unfortunately. I’ll post the changes when I figure it out, though.
Mike Cherim responds:
Posted: April 28th, 2010 at 8:10 pm →
Cool, VH. Again, sorry about not helping more. I get a lot of requests and it can be overwhelming, especially since I’m not really in development any more. Gave myself over to the art of stock photography. Happier.
VH responds:
Posted: April 29th, 2010 at 12:04 pm →
Okay, I’ve got it working:
For anyone who has always wanted to add additional fields to this lovely form, I have written up the following directions. Since this is the first time I’ve written up directions like this, I apologize if they are vague, leave anything out or flat out don’t make sense, but I hope it helps someone do this in less time than it took myself by trial and error.
To add additional fields in the form:
start with form.php: add in text fields or areas by copying the code already in the form and changing it to reflect the new names etc for the field. To add radio buttons, use the following:
code removed
just change “typeplan” to whatever you want to call your item. The way I’ve done it you use the same verbiage from the language file for the label of each button and their values, because it’s a little less to do in the language file, but I assume you can make them different if you want.
Go to your language file, for example en-us. Add the additional language as needed in the following format:
[84] PLAN TYPE LABEL TEXT * Plan Type: [85] PLAN TYPE 1 LABEL TEXT * 403 (b)
[86] PLAN TYPE 2 LABEL TEXT * 401 (k)[87] PLAN TYPE 3 LABEL TEXT * Profit Sharing
[88] PLAN TYPE 4 LABEL TEXT * Deferred Compensation
When I open it in Notepad I have boxes directly behind each number bracket, but they disappeared when I copied it to here; I am so new at this I have no idea if that makes a difference. In general follow the format already in the file. Make sure you don’t have any repeat numbers in the brackets, or your file will call the wrong one.
Go to functions.php. In the language to variable assignment sections, add in your new variables and the corresponding number from the language file, like so:
$typeplan_label = clean_var(lang_strip($lang_array[84]));
$typeplan1_label = clean_var(lang_strip($lang_array[85]));
$typeplan2_label = clean_var(lang_strip($lang_array[86]));
$typeplan3_label = clean_var(lang_strip($lang_array[87]));
$typeplan4_label = clean_var(lang_strip($lang_array[88]));
Make sure they are in the same order as the language file or it will not work.
Scroll down to the posted data section. Add a new line for each field, like so:
if(isset($_POST['typeplan'])) {
$typeplan_value = clean_var($_POST['typeplan']);
}
Add a line in the exploit filter matching:
preg_match($inpt_expl, $typeplan_value) ||
and below that:
if(preg_match($inpt_expl, $typeplan_value)) {
$expl_typeplan = '‘.$typeplan_label.’,’;
$typeplan_border = $error_border;
$typeplan_errlbl = $error_label;
}
put it in the user message list below that -
'.$expl_typeplan.'
then smarten up the email by adding a section there:
if($typeplan_value == "") {
$typeplan_email = "";
} else {
$typeplan_email = " $typeplan_label : $typeplan_value\n";
}
Finally, put it in the email build here:
$typeplan_email
arranging it where you want it to show up in the email.
Save and upload. You should be able to add as many additional fields as needed this way. At least, it worked for me, and if it doesn’t for you at least you’ve got a starting point.
Mike, if you want to give this a quick once over just in case anything looks wildly unsafe, and or if you’d like to add radio buttons onto the basic form so people could customize a little easier, feel free. Thanks again!
VH responds:
Posted: April 29th, 2010 at 12:07 pm →
Well bother, the code tag didn’t take on the first section, let me try to put that one again:
code removed
VH responds:
Posted: April 29th, 2010 at 12:10 pm →
Okay, I don’t know why it’s not showing up. And that’s the part that gave me the most fits, too, so I’d like to get it posted where it will show. One more try:
code removed
VH responds:
Posted: April 29th, 2010 at 12:14 pm →
<label id="typeplan" for="typeplan" class="opt-label"<?php echo $typeplan_errlbl; ?>><?php echo $typeplan_label; ?>
<abel id="typeplan1" for="typeplan" class="opt-label"> <input type="radio" name="typeplan" value="<?php echo $typeplan1_label; ?>" /><?php echo $typeplan1_label; ?></label>
<label id="typeplan2" for="typeplan" class="opt-label"> <input type="radio" name="typeplan" value="<?php echo $typeplan2_label; ?>" /><?php echo $typeplan2_label; ?></label>
<label id="typeplan3" for="typeplan" class="opt-label"> <input type="radio" name="typeplan" value="<?php echo $typeplan3_label; ?>" /><?php echo $typeplan3_label; ?></label>
<label id="typeplan4" for="typeplan" class="opt-label"><input type="radio" name="typeplan" value="<?php echo $typeplan4_label; ?>" /><?php echo $typeplan4_label; ?></label>
</label>
VH responds:
Posted: April 29th, 2010 at 12:15 pm →
hah, maybe if I’d followed directions the first time…
Mike Cherim responds:
Posted: April 29th, 2010 at 12:49 pm →
Lol, you did good my friend. Yes, writing code in the comments requires some effort. Sorry about that.
Jonathan Harris responds:
Posted: May 10th, 2010 at 8:16 am →
Hi, installed GBCF-V3 and got it working in a ‘draft’ subdirectory on my public_html folder on my host. Now its gone live, I moved everything out of the draft subdirectory into public_html and updated all my links. Everything works fine, inluding a PHP guestbook I have on there but the form gives me this error:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../http://www.fast-global.com/assets/gbcf-v3/files/functions.php) is not within the allowed path(s): (/home/fastglob:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/fastglob/public_html/assets/gbcf-v3/form.php on line 48
Not sure what gives? I have checked and double checked, my paths and links. But just the process of moving the form seems to have broken something.
Thanks in advance
Jonathan
Mike Cherim responds:
Posted: May 10th, 2010 at 8:30 am →
This stands out as a problem:
../../http://www.fast-global.com/assets/gbcf-v3/files/functions.php
, but I don’t know how the../../
were added, but that certainly kills the path (hence file not able to be opened).scott farrell responds:
Posted: May 25th, 2010 at 8:59 pm →
I found its easy to clash some of the themes in your plugin, with others already on my site
for example, blue_anvil contains class=’button” for for to be submitted.
If you pre fix everything with gbcf - it would avoid the clash. class=”gbcf_button”
using WordPress-Ready Contact Form v.2.0WP
Mike Cherim responds:
Posted: May 25th, 2010 at 9:30 pm →
Yep.
Gary responds:
Posted: May 30th, 2010 at 5:30 pm →
Great script. A problem now occured since hosts upgraded server upgraded to php 5.3 ..
Deprecated: Function eregi() is deprecated in public_html/gbcf-v3/files/functions.php on line 744
Deprecated: Function eregi() is deprecated in public_html/gbcf-v3/files/functions.php on line 747
Deprecated: Function eregi() is deprecated in public_html/gbcf-v3/files/functions.php on line 750
Deprecated: Function eregi() is deprecated in public_html/gbcf-v3/files/functions.php on line 753
Deprecated: Function eregi() is deprecated in public_html/gbcf-v3/files/functions.php on line 849
I tried replacing with
preg_match
but I could not get it to workI tried replacing with
str_replace
and again it didn’t work.Anyone have any ideas ?
Gary responds:
Posted: May 30th, 2010 at 5:53 pm →
Holy hell I have fixed it !
First time in my life. Hopefully an expert here can check it and if its ok then maybe it can be used in an update…
Firstly I replaced all
eregi
withpreg_match
…Secondly
line 744 … I replaced
if(preg_match("Windows", $ua ) && preg_match("msie", $ua) && preg_match("[7]",$ua)) {
$nua = "IE 7 on Windows";
with
if(preg_match("/Windows/i", $ua ) && preg_match("/msie/i", $ua) && preg_match("[7]",$ua)) {
$nua = "IE 7 on Windows";
Then repeated the same all the way down to line 804, making the same changes and it works. I am not a php coder so please can someone check that I have not made the script vulnerable.
Thanks.
Mike Cherim responds:
Posted: May 30th, 2010 at 9:03 pm →
Thanks for posting that script update, Gary. I knew this day was coming. :/
isengaurd responds:
Posted: June 20th, 2010 at 8:40 pm →
HI,
I am using your latest release for Wordpress. I have an issue that I have not seen on either page of comments: no matter how I fill out the configuration page, the parameters do not save, even when the update successful message comes up at the top of the config page. I have followed all directions in the read me. I must have missed something somewhere…
I have no idea what could be causing this. I have looked at the WP error log and not found anything relevant (afaik). Any suggestions? Every time i go to the config page, it defaults to the unconfigured state that it shows at install. All of the files in the wp-gbcf directory are set for 666, for what its worth.
Thanks for any help
Mike Cherim responds:
Posted: June 20th, 2010 at 9:41 pm →
No need to set those files as you did, otherwise I do not know what it is yet. One other person has reported this anomaly. It might mean that the plugin is no longer compatible with WP starting with version three. I need to know if anyone has it working with WP3, in which case that mean it’s something else. We’ll get closer to knowing that is. Do contact Mike Jolley as he is the WP side of the form.
isengaurd responds:
Posted: June 21st, 2010 at 12:24 am →
Ok, will do. Thanks for taking the time. Hope it’s something simple…
Mike Cherim responds:
Posted: July 10th, 2010 at 10:01 am →
IMPORTANT UPDATE: The WordPress plugin version of my contact form has been updated to version 2.1 thanks to the hard work of Mike Jolley. If you are using WordPress 3.0 or later, you will want/need to upgrade. Other improvements were also made to the script you’ll surely appreciate. Enjoy.
VH responds:
Posted: September 1st, 2010 at 1:44 am →
More questions - client wants to use reCaptcha with this form. Possible?
Mike Cherim responds:
Posted: September 1st, 2010 at 3:47 am →
Yes, everything’s possible, the difficulty dependent on which version. If it’s v3, good luck. But, I’d talk the client out of it. Serious. They’re just wasting money. The form is spam [bot] proof as it is, adding that will hamper its accessibility, for absolutely no reason whatsoever. My forms have all sorts of security controls (most you can’t see), it doesn’t need another one.
VH responds:
Posted: September 1st, 2010 at 10:59 am →
They think the question/answer thing is silly. That’s the main reason.
Mike Cherim responds:
Posted: September 1st, 2010 at 12:34 pm →
No more silly than CAPTCHA! Do this: hard code the answer and comment the thing out. Doing so will semi-disable it, but the form has other controls so ‘bot spam still won’t be an issue.
VH responds:
Posted: September 2nd, 2010 at 7:54 am →
I think I talked them into keeping the text. Thanks for the suggestion though.
Sharon responds:
Posted: September 11th, 2010 at 5:36 pm →
Newbie Here….
Per your install instructions below for Secure and Accessible PHP Contact Form….Where do I find Write Page, On Configuration - no place to add the URL, Where is Manage section, Page file open - is this the New Page where the form is going to go?
On my admin Contact Form section I have Overview, Configuration, Styling and Documentation
#6 Once configured as much as you can, go to the “Write” page and click the “Write Page” If using a default page template give it a name like “Contact Page,” for example.
#7 Now go back to the “Configuration” page and add the URL of your newly-created form page. “Save” your changes.
#8 Now go to “Manage” and click on “Edit Pages” link on the sub-menu. Then locate your contact page an click on the “Edit” link to the right of it.
#9 With the page file open, add this code to the text area and “Save” the page.
Thank you for your help.
Mike Cherim responds:
Posted: September 11th, 2010 at 8:03 pm →
I’m not sure. Your best bet is to ask Mike Jolley (he handles the WP side of the script) since I haven’t even seen version 2.1. Sorry.
Sharon responds:
Posted: September 11th, 2010 at 10:46 pm →
Thank you Mike. Do you have contact information for Mike Jolley?
Mike Cherim responds:
Posted: September 12th, 2010 at 7:28 am →
Mike Jolley is the other guy who is linked from the form footer.
Clayton Tycksen responds:
Posted: September 25th, 2010 at 1:01 am →
Hi Mike,
Awesome form - it’s working perfectly for me on Safari, Firefox, Opera, and Chrome, on both Mac and Windows. BUT on IE8 I get nothing. No errors, no success, nothing. The exact same thing happens with the test-form.php - it also works on every browser except IE8, without modification.
I’m referring to v3. Has anyone else seen this happen?
Validation checks out.
Thanks for the awesome script!
Clay
Clayton Tycksen responds:
Posted: September 25th, 2010 at 1:16 am →
FRESH install, re-edited my CONFIG.php and en-us language pages, didn’t touch anything else. Uploaded all, and it works now, even IE8.
Not sure what happened. Just goes to show that it’s always the user’s fault, eh?
Thanks for the form!
Here’s hoping for an IE-free Internet someday. Cheers!
-Clay
Mike Cherim responds:
Posted: September 25th, 2010 at 1:40 am →
All’s well that ends well. Wish I read this before responding to your email.
Tim Jefferies responds:
Posted: December 31st, 2010 at 3:30 am →
For those with the thankyou page redirect problem.
This fixed it for me.
in function.php:
if($thankyou_page == "yes") {
echo "";
###@header('refresh: 0; url='.$thankyou_url.'');## old redirect
}
Derek Beck responds:
Posted: January 15th, 2011 at 6:13 am →
I saw the previous response on reCAPTCHA… is it really that hard to integrate with this? I understand you have plenty of security steps, but part of my desire for reCAPTCHA is that I am a writer, and having working with old documents and scans for the research for my first (forthcoming…) book, I like the idea that reCAPTCHA is also helping to digitize books. So I’m sort of dead-set on using it with my contact forms. What are your thoughts on the ease of integrating it with your php form? Thanks! Derek
Mike Cherim responds:
Posted: January 15th, 2011 at 8:31 am →
I’ve never tried it Derek.
lena responds:
Posted: February 13th, 2011 at 12:04 pm →
Hi,
I’m trying to fix the code using Gary example:
if(preg_match("Windows", $ua ) && preg_match("msie", $ua) && preg_match("[7]",$ua)) {
$nua = "IE 7 on Windows";
with
if(preg_match("/Windows/i", $ua ) && preg_match("/msie/i", $ua) && preg_match("[7]",$ua)) {
$nua = "IE 7 on Windows";
but I’m wondering what will be for other different strings like:
else if(preg_match("Macintosh", $ua ) && preg_match("camino", $ua)) {
$nua = "Camino on Mac";
}
and
else if(preg_match("Windows", $ua ) && preg_match("safari", $ua)) {
$nua = "Safari on Windows";
}
Thanks for your help
Mike Cherim responds:
Posted: February 13th, 2011 at 12:45 pm →
Yes, each statement in the browser detection section will need amending to work for all users. When self-testing I believe only the browser-in-use statement is used/tested I think, so the other can still be wrong only to be triggered by someone else.
lena responds:
Posted: February 13th, 2011 at 2:21 pm →
ok but what will be the replacement for these 2 strings, these are different from the first strings
else if(preg_match("Macintosh", $ua ) && preg_match("camino", $ua)) {
$nua = "Camino on Mac";
}
and for this one
else if(preg_match("Windows", $ua ) && preg_match("safari", $ua)) {
$nua = "Safari on Windows";
}
Mike Cherim responds:
Posted: February 13th, 2011 at 3:26 pm →
Same as the other
$ua
strings, just replace the parts as they exist in those other, older strings (comment them out if you wish). If I wrote all the strings here I may as well update the script but I don’t really have the time. For more information about browser sniffing, see this old experiment of mine.ETA: The source page specifically.
Evan responds:
Posted: March 1st, 2011 at 9:02 pm →
Hello Mike, I really like your script. I tried it and it works perfectly. Could you please explain in more detail how can I disable the security question? I know, you said that one should “hard code the answer and comment the thing out” in form.php but I am kinda lost.
Thanks!
Mike Cherim responds:
Posted: March 1st, 2011 at 9:27 pm →
Evan, the input has an empty value,
value=""
. Fill that in with your answer content, then hide the entire input using comment tags. People won’t have to fill it in and it will always be right when the form is submitted. Commenting it out only hides it from view, but doesn’t disable that part (though that part will no longer be effective in fighting spammers).Evan responds:
Posted: March 2nd, 2011 at 9:41 am →
Thank you for the swift response Mike! However, I had no success. The thing is that the only value=”" that I can find in form.php is at line176 (next to name=”honeypot”). When I fill that in with the answer, nothing happens. However, I found that the answer field is filled with my answer when I replace value=”" with value=”my answer” in line 171. Unfortunately, I can’t comment it out -it just displays /* */ between the fields. What am I doing wrong? Could you please tell me specifically which lines must I comment out?
Thanks again, I know that it is crazy to remove the anti-spam question, but I have a similar client as VH who prefers captcha (duh!) instead of a logical question. He finds the latter “stupid and looking as we are mocking our visitors”. I will have to rely to the other security measures of your form to prevent spambots and hopefuly convince him in the future to use the anti-spam question.
Mike Cherim responds:
Posted: March 2nd, 2011 at 9:56 am →
The honeypot is a different trap. Regarding the commenting, it looks like you’re using the wrong type. Use this
<!-- this won't show -->
Evan responds:
Posted: March 2nd, 2011 at 10:09 am →
OK got it right with the commenting, thanks. But now, when I press “send”, I get a “Notice: Undefined index: antispam in C:\inetpub\wwwroot\gbcf-v3\files\functions.php on line 668″ mesage. Should I edit something in functions.php as well or just leave the whole thing as you originally made it to work?
Mike Cherim responds:
Posted: March 2nd, 2011 at 11:07 am →
I have no idea, Evan.
matthew responds:
Posted: March 7th, 2011 at 5:58 am →
Hello,
Having just installed and activated your contact form plug-in, I’m struggling to locate the “Contact Form” page, which I understand should be listed on my WP 3.1 navigation menu. I know that the recent 3.1 upgrade made a few other things less obvious, any chance that it’s affecting accessibility to the Contact Form page? Or am I just not seeing something obvious? Thanks for a little guidance.
matthew responds:
Posted: March 7th, 2011 at 6:05 am →
I knew that I’d see my answer as soon as I post my question…but for any other newbies using WP 3.1, the “Contact Form” page is found by clicking a blank (icon-less) button at or near the bottom of the WP navigation menu bar.
Mike Cherim responds:
Posted: March 7th, 2011 at 9:22 am →
Good to know. I haven’t even seen it so this is good info. Version 2.1WP was Mike Jolley’s baby, not mine.
John responds:
Posted: March 15th, 2011 at 2:09 pm →
Hi Mike,
Thanks so much for the form - I’ve used it before with success… but am having trouble getting it to work on a new WP site. Please excuse my ignorance in advance (i am a designer with limited coding abilities). The form loads fine as you can see here:
http://www.aaronmatthews.com/contact
but on submit, I get a 404 error. The only thing I could think of is that the form is trying to add the variable “#results” to the URL.. and the permalink structure I am using writes pages as directories (”/contact/”) instead of .php files. I’m not totally certain that this is my problem, and I’ve set the permalink structure back to the WP default and still got the error… but I am at a loss. Any suggestions you may have would be greatly appreciated… I understand if you are too busy to help me with my stupidity
Mike Cherim responds:
Posted: March 15th, 2011 at 2:56 pm →
Hmm, I don’t recall seeing that before. It should submit to contact/#results, not contact#results. I think that’s the issue. You need top use .htaccess to add the slash I unless you can do it from within the site’s nav structure. I think.
John responds:
Posted: March 15th, 2011 at 3:06 pm →
thanks for the reply, i switched the permalink to have the slash, and still no luck. Oh well, i’ll try moving things around a bit more and see if i can figure it out.
thanks again!
Dave responds:
Posted: April 13th, 2011 at 9:11 am →
Hi Mike,
Always been a big fan of your contact forms. I managed pretty well with version 2 to edit the form the way I needed it, However, in version 3 I am having dificulty denoting the Phone Number field as a required/obligatory field. Any advice ou may be able to give will be greatly appriciated!
Cheers
Mike Cherim responds:
Posted: April 13th, 2011 at 9:59 am →
I can’t really help, Dave. Unfortunately it’s a LOT more complex, necessary so I cold add some of the other features. To do it you’d have to edit the form.php and functions.php files, moving the phone input into a required fieldset and other script changes to make it actually required. It’d be a fair chunk of work I think, especially if you wanted to keep it right.
Dave responds:
Posted: April 13th, 2011 at 10:25 am →
Thanks for reply Mike.
Its ok, I have done it now. Its like you just said : functions.php and form.php. Actually, once you know where things are, its not that bad.
Done now anyway, Thanks
Mike Cherim responds:
Posted: April 13th, 2011 at 12:05 pm →
Awesome, Dave
Steve responds:
Posted: April 25th, 2011 at 5:08 pm →
I use this in Spanish, utf-8.
If the sender name contained accented characters I found that emails received in Outlook 2007 would have the accented characters corrupted in the header only, while the message body would be fine.
It appears the header info must be encoded for this to display correctly.
To cut a long story short, this was the only fix I found that worked:
in functions.php at line 700: find
$mail_header = "From: $name_value <$mailfrom_value>\n"."Reply-To: $name_value <$email_value>\n"."MIME-Version: 1.0\n"."Content-type: text/plain; Content-language: $language; charset=\"$char_set\"\n"."Content-transfer-encoding: quoted-printable\n\n\r\n";
and change it to
//encode $name_value
$name_value_header = '=?' . 'UTF-8' . '?Q?' . preg_replace('~[\x80-\xFF=?_]~e', '\'=\' . strtoupper(dechex(ord(\'$0\')))', $name_value) . '?=';
// $name_value changed to $name_value_header in next line
$mail_header = "From: $name_value_header <$mailfrom_value>\n"."Reply-To: $name_value_header <$email_value>\n"."MIME-Version: 1.0\n"."Content-type: text/plain; Content-language= $language; charset=\"$char_set\"\n"."Content-transfer-encoding: quoted-printable\n\n\r\n"
Mike Cherim responds:
Posted: April 25th, 2011 at 8:53 pm →
Thanks Steve.
Frank Hagan responds:
Posted: May 29th, 2011 at 1:12 pm →
Mike - my compliments on the script; one of my customers notified me he was using it and the recent upgrade to PHP on the server was showing some errors in the error_log file. I was happy to see that you support the script so well.
For the replacement of the deprecated “eregi” function that Gary fixed above, here is the complete code block that has worked for me. First, download the /gbcf-v3/files/functions.php file, copy it to another folder as an archive you can always return to, and edit the original. Replace this entire section:
With this code:
Save and upload the file, replacing the /gbcf-v3/files/functions.php file.
Mike Cherim responds:
Posted: May 29th, 2011 at 1:41 pm →
Awesome, Frank. Thanks a lot.
Frank Hagan responds:
Posted: June 29th, 2011 at 9:36 am →
Well, unfortunately my code above is now throwing a “Delimiter must not be alphanumeric or backslash in functions.php line …”, so my solution above does not work. I will report back when I figure out how to fix it.
Frank Hagan responds:
Posted: June 29th, 2011 at 9:45 am →
OK, I’m officially an idiot. I didn’t escape the OS or browser name in all of the entries (I only had them escaped in the first three). Here’s the corrected code snippet:
### Sniff browsers to return a better string
if(preg_match("/Windows/i", $ua ) && preg_match("/msie/i", $ua) && preg_match("[7]",$ua)) {
$nua = "IE 7 on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/msie/i", $ua) && preg_match("[6]",$ua)) {
$nua = "IE 6 on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/msie/i", $ua) && preg_match("[5-3]",$ua)) {
$nua = "Old IE on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/firefox/", $ua)) {
$nua = "Firefox on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/opera/", $ua)) {
$nua = "Opera on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/mozilla/", $ua)) {
$nua = "Mozilla on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/netscape/", $ua)) {
$nua = "Netscape on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/flock/", $ua)) {
$nua = "Flock on Windows";
}
else if(preg_match("/Windows/i", $ua ) && preg_match("/safari/", $ua)) {
$nua = "Safari on Windows";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/camino/", $ua)) {
$nua = "Camino on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/firefox/", $ua)) {
$nua = "Firefox on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/opera/", $ua)) {
$nua = "Opera on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/mozilla/", $ua)) {
$nua = "Mozilla on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/netscape/", $ua)) {
$nua = "Netscape on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/seamonkey/", $ua)) {
$nua = "Seamonkey on Mac";
}
else if(preg_match("/Macintosh/i", $ua ) && preg_match("/safari/", $ua)) {
$nua = "Safari on Mac";
}
else if(preg_match("/Linux/i", $ua ) && preg_match("/konqueror/", $ua)) {
$nua = "Konqueror on Linux";
}
else if(preg_match("/Linux/i", $ua ) && preg_match("/firefox/", $ua)) {
$nua = "Firefox on Linux";
}
else if(preg_match("/Linux/i", $ua ) && preg_match("/mozilla/", $ua)) {
$nua = "Mozilla on Linux";
}
else if(preg_match("/Linux/i", $ua ) && preg_match("/opera/", $ua)) {
$nua = "Opera on Linux";
}
else if(preg_match("/FreeBSB/i", $ua ) && preg_match("/firefox/", $ua)) {
$nua = "Firefox on Free BSD";
}
else {
$nua = $unk_useragent;
}
I’ll do more testing and report back if there’s still a problem, but I think that’s what I did wrong above.
Frank Hagan responds:
Posted: June 29th, 2011 at 9:56 am →
It seems to be working. Also, on line 849 is the email validation regular expression that also uses eregi, and is deprecated. I commented out the line using eregi, copied it and changed it to use preg_match, and it seems to be working fine. Here’s the complete ### Email formation check block of code:
### Email formation check
### else if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})", "$email_value")) {
else if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})/", "$email_value")) {
$bad_email = '‘.$email_label.’‘;
$email_border = $error_border;
$email_errlbl = $error_label;
$user_message = ‘‘.$bademail_err.’: ‘.$bad_email.’‘.”\n”;
$form_status = “nogo”;
trip_error();
}
I think that works without a “/i” at the end since the regular expression includes both upper and lower case already. If someone in the know can verify it for others, that would be great.
Mike Cherim responds:
Posted: June 29th, 2011 at 10:19 am →
Awesome Frank. Thanks!
Dave responds:
Posted: August 4th, 2011 at 9:39 pm →
I have been using your script for years without issue, LOVE IT, THANK YOU!
But I just recently noticed the following characters appearing on the website within the form, right before the beginning of the required fields :

I cannot find these characters within any code in any file. They also appear on the success page after a form has been submitted. Our server/site has not been hacked to my knowledge.
Otherwise, the form works fine to my knowledge. Any ideas? Thank you!
Dave responds:
Posted: August 4th, 2011 at 10:01 pm →
So sorry, v3 for me. Also, characters appearing in all browsers.
Thanks for any ideas on where I can start looking or in what file…
Mike Cherim responds:
Posted: August 5th, 2011 at 12:37 am →
It’s an invisible character seen as a space, sometimes. I’ve seen that before and it’s weird. I’m not positive what caused it last time, but it could have been someone had the language file open in Word or something like that, made changes, then saved it using that program. If that’s right, the language file would have needed to be opened in Notepad or other plain text editor and the offending spaces and characters like typographers’ quotes, m-dashes, and such removed, then re-saved using that program. If that isn’t it, I don’t know what it is or what caused it.
Dave responds:
Posted: August 5th, 2011 at 5:02 pm →
Thank you as always for your input and willingness to help. Now I have two sets of characters. ?
Yeah, figured it’s a space somewhere, but I cannot find a thing. Characters still there even when I upload your unedited files. Obviously I’m missing something or where it is really coming from… your files or my .php page.
Wondering about if a file gets messed up when publishing? Would publishing them through Expression or otherwise be the culprit, instead of ftp?
And, if I open form, en, or other files to edit, what format should they be saved in… ansi, unicode, utf-8? I’ve had issues caused by that too in the past.
Thanks again for any other ideas or where to look…
Mike Cherim responds:
Posted: August 5th, 2011 at 7:03 pm →
I’m not sure what that is but I’ve always used FTP for uploading files to my server. I prefer utf-8 and would recommend that for all of your web pages. Two sets of characters now… the second added when you open then saved the language file? If that’s the case, try downloading the form again, and upload the language file only, via FTP . Does that fix the issue?
Dave responds:
Posted: August 6th, 2011 at 10:24 am →
Thank you again, Mike.
Yeah, 2nd set of characters showed up in the same place when a file was published, but I don’t think it had anything to do with the “en” language file, instead, I think it happened when the form.php file was uploaded. However, when following your advice and uploading fresh files from your package numerous times over, they still appeared.
I have now pulled every hair out of my head trying to find any hidden spaces, characters, etc. in all files used, and have failed. I am not an attractive bald man. So, I resorted to changing the meta at the top of my contact page with charset=utf-8 (previously something like windows-1252).
That took care of the characters, they do not appear, and everything seems to work fine. But not sure how that will affect anything else as the site/page was working fine before. ? Thoughts? Thanks again!
Mike Cherim responds:
Posted: August 6th, 2011 at 11:01 am →
Cool. You’re better off using utf-8 on your pages anyway so you should be good to go.
Javier responds:
Posted: August 25th, 2011 at 4:45 pm →
I have the script (GBCF v3) working fine but when I try to send the form to multiple addresses neither address gets an email. It should be like this on the config file right?
$send_email = “email1@gmail.com,email2@gmail.com”;
When i use one address it works fine.
Mike Cherim responds:
Posted: August 25th, 2011 at 6:47 pm →
You’re doing it right, but no, it doesn’t work with v3… sorry.
Frank responds:
Posted: September 30th, 2011 at 6:28 am →
Hi there, using V3.
I replaced all the eregi functions, but still have an error on my email check.
The solution Frank Hagan had, gave the following error on my script:
Parse error: syntax error, unexpected T_STRING in /var/www/g45223/acproducties.nl/HTML/gbcf-v3/files/functions.php on line 865
Mike Cherim responds:
Posted: September 30th, 2011 at 8:48 am →
Did you copy and paste what he wrote? I ask because there are bad characters that would cause and error. For example, an apostrophe or quote mark that’s curly/fancy, like this ‘ or ” will throw up an error compared to plain characters like
'
or"
. WordPress does the conversions so copying and pasting will cause issues unless it’s cleaned up to remove those bad characters.Frank responds:
Posted: October 3rd, 2011 at 9:37 am →
Hey Mike, thanks for your quick reply.
It were does pesky apostrophs! I replaced them by ” & ‘ and got the form to work!
Thanks alot!
Mike Cherim responds:
Posted: October 3rd, 2011 at 10:07 am →
Awesome.
Michael Barrish responds:
Posted: November 12th, 2011 at 3:50 pm →
Hi Mike,
You helped me many years ago, and I’ve been using GBCF ever since!
Today I’m having a problem with version 2. It’s the “Anti-Spam Trap 1 Field Populated” message. As per http://green-beast.com/blog/?p=128#comment-7944 , I tried changing the $form_location variable to the contact page URL, to no avail.
The only thing possible cause I can think of is that I’m using a site preview domain (this is at Media Temple). I actually don’t know why that would be a problem because the URL is accessible from anywhere, but it’s the only thing that seems different about this setup.
The contact page is at http://oblivio.com.s18531.gridserver.com/contact/index.php
Thanks,
Michael
Mike Cherim responds:
Posted: November 12th, 2011 at 6:19 pm →
Sorry, Michael. I really don’t know. The value is empty, I looked with styles off and source, so I really don’t know why it’d be tripping on you.
Michael Barrish responds:
Posted: November 15th, 2011 at 5:40 pm →
Mike, thanks for checking it out. In a strange way, I’m pleased to have stumped you.
Now, I know this flies in the face of the purpose of the form, but is there a way to disable Anti-Spam Trap 1? I’m expecting you to say, no, that the traps are baked into the PHP and would be a lot of work to “unbake,” but I figured I’d ask anyway. I’m stumped too.
Mike Cherim responds:
Posted: November 15th, 2011 at 6:10 pm →
I don’t think it’d be that difficult to do, just find that operation in the main functions file and comment it out so it no longer checks that spam trap (it’s one of many so no big worries). That said, I think in the long run you’d be better off figuring out why it’s being tripped. Something’s off.
Mike Cherim responds:
Posted: November 16th, 2011 at 10:29 am →
UPDATE: I’ve decided to close this post. The comments and questions have slowed to a trickle so I feel my contact form will suffice for further communication. So, if you want support and cannot find your answer herein (do check out previous entries), please feel free to contact me for support. If you’re looking for support for the contact form plugin for WordPress, you’re probably better off contacting Mike Jolley.