Secure and Accessible Contact Form v3
I’m happy to announce the availability of version three of my GBCF-v3 Secure and Accessible Contact Form. It offers a ton of improvements over version two in the areas of perfected error management, easy language adaptability, passive set-up validation assistance — so the script can be tested before putting it on your site — security, usability, powerful flexibility, and enhanced accessibility. On this last front two notable features include: the form’s ability to automatically adapt to the user’s preferences maintaining the semantics and accessibility and; the form’s refined usage of labels and legends to make the experience of using the form a smart one for screen reader users.
In addition to all of the enhancements, I addressed all of the concerns surrounding version 2. I mean all of them. This form version really is quite a step up from the last one. I hope you’ll be wow’d. Do check out the pages where a lot more info can be found. The demo site index is a special page I put up for the demo only, but the script validation page, form help page, and form test page are actually included with the download. They aren’t meant to be kept on the server, but they offer a good resource for users installing it. The is one deep script, done right… I hope you agree.
Before I open the floor to comments and support questions not yet answered, I am requesting some help in the form of language translators to work on the language files that come with the form. You will be credited accordingly (note the language files already done). I’m also open to having people contribute some theme style sheets, (images are accommodated). Want to help?
Stats: Since its initial release on December 30th, 2007, GBCF-v3 has been downloaded 109559
times.
Attention: There is a new post for form support. Please use it to post your comments, questions or suggestions. Please, however, review the comments herein first to see if your question or concern has been addressed already. Thank you.
David Zemens - 1955 Design responds:
Posted: January 1st, 2008 at 8:45 am →
I thought you had been awfully quiet lately. Now I know one of the reasons why. I can hardly wait to check out the new form, Mike. Thanks for all the work.
HAPPY NEW YEAR!
Gill responds:
Posted: January 1st, 2008 at 9:19 am →
I’ve been playing with it as requested and it’s looking good so far but it’s slow going due to my ISP crawling under the weight of everyone being off work/school. I’ll get back to you as soon as I’ve been able to really hammer it.
Nice New Year’s present though!
Dan Schulz responds:
Posted: January 1st, 2008 at 3:18 pm →
Thanks for the update, Mike. Any idea when the WordPress plugin version will be available, assuming you are keeping up development of that as well?
Mike Cherim responds:
Posted: January 1st, 2008 at 3:31 pm →
@Dan: As soon as I flesh out any issues, and give this version a little real world road time, I plan on getting together with Mike Jolley and turn this into v3-WP. Already I have started on a plan of attack. If I have my wish, this exact version will work on WP with a single file added to handle talking to the database, back-end configuration, and language gettexting within the WP system. If that becomes possible, it’ll be awesome for doing upgrades and stuff since there will be less to maintain.
Gill responds:
Posted: January 1st, 2008 at 6:59 pm →
Whoo Hoo! Well done that man.
Very easy install, worked first go. Found one typo and a line in the instruction text file that might need to be a bit clearer for some of your less experienced customers, I’ll ship details through as soon as I’ve finished testing.
I can rattle off a couple of themes for it this week before I hit the client sites again.
Translations for German and Spanish should be with you by Friday.
Do you need Australian?
Dan Schulz responds:
Posted: January 1st, 2008 at 9:31 pm →
No problem, Mike. I’ll keep an eye out for it.
Mike Cherim responds:
Posted: January 1st, 2008 at 11:50 pm →
@Gill: Thanks for the info… I’ll look for your email. A typo is no surprise hehe.
That sounds great. Thanks. Regarding Australian and I was wondering about that. Same with Canada. Does en-gb work? Should there be a separate one? Is there a “en-au” and “en-ca” to use? I wrote the “en-gb” one so I don’t even know if it’s sufficient… it’s probably be better to have someone from the UK do it. I took a stab at it, though. There weren’t really too many changes. A few. The “en” one, for example, uses the word “organization” for that label, but it the “en-gb” uses “organisation,” and the “en-us” one I put “company.” They’re all so close.
Longhair responds:
Posted: January 2nd, 2008 at 4:45 pm →
Is there a way to have random questions instead of just one?
What about adding something like Image Magic in place of the question?
Many thanks for making this script for us computer illiterate people
Mike Cherim responds:
Posted: January 2nd, 2008 at 5:36 pm →
@Longhair: I was considering trying to add a random question, but it really hasn’t proven necessary. Regarding “Image Magic,” I can’t say I’ve ever heard of it.
Sri responds:
Posted: January 2nd, 2008 at 11:08 pm →
There is in fact an “en-ca” for Canadian English, I haven’t gone through and looked at your form in detail, but in the written form Canadian English tends to lie somewhere between British and US dialects (ie. British spelling, but American vocabulary… “colour” instead of “color”, but “truck” instead of “lorry”). Confused yet?
Though in reality, us Canadians are accustomed to seeing everything in US english… so we won’t be wondering “what’s a ZIP code?” since everyone here knows that’s just American for “postal code”.
Note: if the form handler validates postal codes for format, remember that Canadian codes are different from the US versions, on the other hand, phone numbers are formatted the same.
Jermayn Parker responds:
Posted: January 3rd, 2008 at 1:01 am →
“en-uk” should be ok for us Aussie readers, as the main problem is the ’s’ instead of ‘z’ (organisation) and ‘our’ instead of ‘or’ (colour).
Longhair responds:
Posted: January 3rd, 2008 at 4:41 am →
Thanks for the fast response
I remember setting up message boards in the past and the best way to explain what I mean by “Image Magik” is to visit http://forums.ikonforums.com/index.cgi?act=Reg;CODE=01;COPPA=false and find Secure Registration Key. At the right of it, there will be a box with random numbers that is in a picture form that cannot be copied and every time you refresh the page, it will change.
(Go ahead and delete the above link because that is the best example that I could find and I don’t want people thinking that I am plugging anything.)
Mike Cherim responds:
Posted: January 3rd, 2008 at 6:03 am →
@Sri: Thanks for the clarification. On the en-us I do call it Zip code, on the en-gb it’s Postal code, and on the plain old en — I tried to make it a bit more universal so I went with Zip/Postal code with it.
@Jeramyn: Thanks for adding that.
@Longhair: I’ll leave the link so others can to see the example, but that is a classic image CAPTCHA. The problem with it is it’s not very accessible. Image text can only be read visually (but some web users can’t see), and even at that the text is hard to read by design and cannot be enlarged. Some CAPTCHAs also offer a recording some circumvent this shortcoming.
Gill responds:
Posted: January 3rd, 2008 at 6:23 am →
@Longhair - I can assure you there is no need to have a Captcha on Mike’s form. I’ve been using version 1 and 2 for some considerable time now on both my site and client sites, and unlike the the old forms I used that did have Captchas, Mike’s has never delivered so much as a single spammy mail. The traps are done in other ways and seem very effective.
Longhair responds:
Posted: January 3rd, 2008 at 7:45 am →
Mike & Gill, thanks for explaining that up for me. I play around with web design once in a great while, and the way things move it is hard to keep up with everything for a person like myself.
Speaking of hard to keep up…
On my main computer (read - comfortable) it is using Win 2000 Pro which means that I am stuck at IE6. On my laptop, I have IE7 and Netscape/Modzilla/Firefox/What-Ever-It-Is-Called for testing purposes. With both of the IE versions, the contact page starts at the left side, while in the “other” browser, it is centered just like on the test-form on this site (which I am viewing with IE6).
Another - for the lack of a better word - flaw is that the “Privacy Policy - Blocked: 59 - Script by Mike Cherim” is having the bottom border cutting making it look like a line-through on both IE versions, but not on the “other” browser. Yet again, on the test-form on this site there is no problems.
I didn’t change anything except for some text colors in the default css - so that rules out operator error.
One other thing that I would like to change is the alignment of “Contact Form” “Optional” & “Required” so instead of it being lined up at the left, it is in the center. How would I be able to do that? I know it a change in the css, but it would take me about a week to find it
Thanks again for everything
Mike Cherim responds:
Posted: January 3rd, 2008 at 8:14 am →
@Longhair: Thanks. I tested the demo on IE6, IE7, FF, NS, OP, and Safari 3 (Win). The issues you’re seeing are probably inherited from your existing styles so you may need to edit more than colors. This is expected, though. Say if a site uses the star selector to zero margin and padding, margin and padding would have to be edited back into styles for the form. The demo site uses very few styles defaulting in most cases to browsers’ native rendering differences (that’s why the form footer text is variables from browser to browser — I see it on IE7 as right on/immediately above the fieldset border).
To align those legends to center, try this:
If you don’t have other legends on your site, you may be able to shorten that to legend { styles }.
Longhair responds:
Posted: January 3rd, 2008 at 1:48 pm →
Mike, I figured out the problem with IE… I needed to make the pages in PHP & XHTML complient.
Now I just need to find a good tutorial on building a basic website in php
Web Standards, Accessibility and Other Stuff » Blog Archive » Recommended Web Standards/Development Articles responds:
Posted: January 4th, 2008 at 12:27 am →
[…] Secure and Accessible Contact Form v3 - from Mike Cherim’s Beast-Blog, a great standards-friendly and accessible contact form (using PHP). […]
Sri responds:
Posted: January 4th, 2008 at 12:07 pm →
Speaking of CAPTCHAs, or a plain-text challenge & response like Mike is using, I don’t think either is really required. I’ve actually stopped using those techniques in favour of one which is both transparent to the user, and (in my personal experience) has been just as effective at controlling comment/contact form spam.
It’s really simple too: when processing a posted form I just check the HTTP_REFERER value, if it’s equal to the URL of the page that the form is supposed to be posted from (ie. MY page) then the form is handled normally, otherwise I ignore the submitted data and just display the blank form.
(you could also use HTTP_HOST or SERVER_NAME if you don’t want to be so narrow as to restrict submissions to only a single page on your site - ie. if you’re going to have multiple contact forms on your site all posting to the same form handler)
That way, if someone were to copy my page to their desktop & submit from there, it would be ignored. As a result, remote scripts trying to post to my page will not work. However, if somebody scripted an actual browser to navigate to the form page to fill & submit it, that would still work. I’m thinking that not too many people do that (too hard).
As an added precaution, when a form is posted successfully I set a “timeout” cookie which disables the form for 1 minute for that user session - this is to prevent someone from manually spamming me by going through a submit/back-button/re-sumbit cycle. It’s not 100% effective to be sure (disabling cookies bypasses it) but it clears the low-hanging fruit as the inconvenience will block most mischief-makers.
I don’t think that these measures inhibit accessibility - if anyone hear sees how it might, I’d be interested in finding out how (and making the needed corrections), especially since I had used this technique with the intent to INCREASE accessibility by giving users less to do, and by avoiding too-hard-to-read CAPTCHAs.
Mike Cherim responds:
Posted: January 4th, 2008 at 12:47 pm →
@Sri: While I agree the anti-spam q and a is overkill (I have lots of overkill on this form so as to stay ahead of the miscreants), my last version had referrer matching and it was a huge pain. You have to remember that lots of users turn off referrer logging on their browser or by way of their ISP or location. All these people would be blocked so for them the form would be completely inaccessible to them. The problems with referrer logging was one of the primary motivators for producing this version. I wanted all those usage blocks removed and have more of the anti-spam controls employed passively — completely independent of anything and everything on the user’s end which is why I don’t use cookies or any JavaScript.
I do employ two remote posting controls, though, so that wasn’t forgotten. In order to use the form the form ID or its variants have to be matched three different ways, requiring local files, thus remote posting is impossible, without the need to apply the problematic referrer logging. My advice: any control using environmental variables is subject to problems and are best avoided in favor of techniques that don’t rely on them.
Regarding flooding (your 1 minute timeout) I do have an optional control in place. The form admin can enable it in the config if deemed necessary (started with build #B3.20071231.01), then they can set the aggression level. It’s not a typical flood control measure (most would use a cookie), but again, I didn’t want anything to rely on the user’s settings or environmental data. My flood control resets the form automatically. The aggression level sets the time elapsed before this happens. If, for example, they set the level to 0 (zero) which is the most aggressive level, the moment the form is successfully submitted the see the result for a slit second then the form is reset and they cannot resubmit with re-entering the data by hand. In some ways this is even better than using the cookie method.
SleeplessinDC responds:
Posted: January 5th, 2008 at 11:26 am →
In the README.txt file, the first step says to “Upzip and check out the readme file”. The second step in the Installation says “Open that file…”. What file is that file?
Mike Cherim responds:
Posted: January 5th, 2008 at 11:33 am →
Sorry about that Sleepless. I did update the readme on the demo site, but didn’t release the newest built yet. I was waiting on a couple of language files coming in very soon. My bad! The file is the CONFIG.php file located in the /files/ sub-directory.
Mike Cherim responds:
Posted: January 6th, 2008 at 3:22 pm →
More languages needed… please
Available as of now are en, en-gb, en-us, fr, da, sv, and it, but I’d also like to offer
Spanish, German,Russian, Polish, and maybe evenJapaneseas soon as possible. I feel those are must-haves. Any and all languages are wanted… step right up folks. Each file should only take about ten minutes to make if the author is fluent.Any volunteers?
Thanks so far go to Gill Lucraft, Mark Barner, Tommy Olsson, and Pierluigi Montinaro for their efforts. Credit for contributions are also made on the demo’s index.
Update 1/6/08 @ 23:11: It looks like I may have Spanish and German coming my way. I’d also like to announce the addition of Finnish (fi) thanks to Dave and Pirjo Prescott. I did four updates today, one big one was to better accommodate deeper installs and multiple installs.
paul responds:
Posted: January 7th, 2008 at 5:19 pm →
oooh, just stumbled across this. i will have to give it a look over. can’t wait for the yummy WP version!
Gill responds:
Posted: January 9th, 2008 at 11:44 am →
Spanish has just been sent.
Mike Cherim responds:
Posted: January 9th, 2008 at 1:23 pm →
Thanks Gill.
Swim Man responds:
Posted: January 9th, 2008 at 1:55 pm →
Awsome script. It was easy to install even for a noob to web programing such as myself. I had a bit of trouble trying to get it to work in my html, but after rereading the FAQ a few times, I finnally grasped my problem which was easly correted. Kudos Mike.
stuart responds:
Posted: January 9th, 2008 at 8:01 pm →
Hi.
The form is very good.
I receive the following problem when I try to add a ‘thank you’ page.
I’m a novice, currently studying web programming. I’m still picking up the ‘tech talk’ so your advice in clear english would be appreciated .
Thanks.
Warning: Cannot modify header information - headers already sent by
> (output started at
> /home/user/card.co.uk/inc/header.inc:5) in
> /home/user/card.co.uk/gbcf-v3/files/functions.php
> on line 1141
The code below makes up my pages.
Mike Cherim responds:
Posted: January 9th, 2008 at 8:53 pm →
Hi stuart, I set it up on another domain to test and for me it worked as expected. It loaded a fresh thank you page, no headers sent errors (no errors). This tells me this has to do with your site’s files or setup (not saying there’s something wrong on your end). Perhaps what I need to do is find a way to silence the error. It’s true the header function is being used the send the user to a thank you page, I don’t think it should be an error.
If anyone has any ideas about stuart’s situation, please speak up. Here’s the code used, active if the form is submitted. I suspect the anti-flood would cause the same thing.
chris responds:
Posted: January 10th, 2008 at 2:50 am →
hi mike. i really appreciate your time working on this contact form.
I’ve installed it on a site and everything looks, works fine.
except… no email is sent. obviously i have modded the config file to include the email.
i set the $smtp_sneak and $ini_set to “yes” but no avail.
I’m planning on donating but I’d love some help in the mean time.
have mercy?
thanks again,
chris
chris responds:
Posted: January 10th, 2008 at 2:52 am →
my apologies. the page where i have installed the contact form is:
http://www.rocksteadyinc.com/index-4.php
best,
chris
Mike Cherim responds:
Posted: January 10th, 2008 at 5:56 am →
Hi Chris. I tested and the form seems fine, and if you’ve done those steps (you did edit the variables after ini set i hope), then it really becomes a matter for your host. I would contact them and ask about the issue. I’ve seen others have a lot of success with that with the last version if the form was sending, but the mail server wasn’t delivering. I’ve seen some servers take up to a day to deliver mail (mine goes instantly), but I have no idea if that has bearing here and now. Please let me know what the host says.
chris responds:
Posted: January 10th, 2008 at 2:40 pm →
Hi Mike. That was it! I got in touch with Yahoo (hosting) and filled in the smtp and port info. Now everything works great. Thank you so much. I have enough knowledge to be dangerous but not always enough to fix things.
All the best,
Chris
Mike Cherim responds:
Posted: January 10th, 2008 at 2:41 pm →
Awesome Chris… gotta love happy endings
Mike Cherim responds:
Posted: January 15th, 2008 at 12:16 pm →
Available Languages Update
As of Jan 15th, 2008, The following language files are currently available:
Monika@The Writers Manifesto responds:
Posted: January 16th, 2008 at 11:04 am →
Hi Mike,
I’m desperate for a WP contact form that runs on the latest WP version. Since updating two of my blogs to the latest version I cannot upload any plugins anymore. They show in the FTP in the plugin directory of my blog, but when I go to my blogs admin and try to activate they are non existent.
Is this form compatible as is for WP, if I follow your “read me” directions, or do I have to wait for your Plugin version to be released?
Monika
Mike Cherim responds:
Posted: January 16th, 2008 at 11:10 am →
Hi Monika, this script isn’t yet a WP plugin, but you should be able to use the contact form plugin currently available. It works in the latest version. Regarding your other issue, check the permission of your plugin folder. It should be 755. If it’s less than that you wouldn’t probably experience what’s going on at your end.
Michael responds:
Posted: January 16th, 2008 at 1:03 pm →
Mike - I’ve been using a cgi formmailer for years, but just moved my site to a new host and can’t seem to get it to work. I’ve been checking out php form mailers and yours looks great. The installation was easy, and worked the first time (a blessing after some of the issues I’ve had recently). I’m looking forward to checking out the WP version for my blog as well.
I just have one issue - I don’t seem to be getting a copy sent to the sender when the “check for email copy” box is checked.
And a few questions. My previous form had a few custom fields, like arrival and departure date, and a few otther details pertinent to my business and the info I’m seeking from customers. I also had a few radio buttons. I haven’t found any info in the faq regarding adding additional fields (other than changing the labels of some optional fields in the language file). Am I missing it, or do I need to make custom changes to the script if I want to add these things, or change the order of the fields? Most likely I can get most of what I need by changing some field labels, but your script is so comprehensive I was just wondering if I’ve missed some options somewhere.
Thanks.
Mike Cherim responds:
Posted: January 16th, 2008 at 1:50 pm →
Hi Michael:
Unfortunately, I don’t know. Spam filtering, authentication required, etc.? I would contact whoever handles your incoming mail for that account. I must admit, the email copy is secondary as far as some of the stuff I put in ensure delivery of the primary email.
Nope, you got it right. To change the ordering and add fields not currently available, you would have to edit the script. The ordering won’t be too bad, but I should warn you that any customizations of that type will probably quite difficult to get right (even field ordering). Sorry, the last form was easier to modify in that way, but lots of people would break it. This time around I offer more automated customization to counter the “I broke my form” support requests, but it was at the expense of user edit-ability above and beyond what’s offered.
Michael responds:
Posted: January 16th, 2008 at 1:57 pm →
Thanks for the quick response Mike. For now I’ll drop the cc option and just edit a couple labels and styles. I can always make a copy and play around with more complex edits on that later. Thanks again. Great script.
Sammy responds:
Posted: January 16th, 2008 at 7:21 pm →
Hi Mike,
Is it possible to turn off the MESSAGE textarea (in Config.php or somewhere else) ? I’m making a simple form with just a name and an email, to subscribe to an email list, and I don’t need the textarea.
Thanks.
Mike Cherim responds:
Posted: January 16th, 2008 at 7:45 pm →
Not easily Sammy, unless you’re willing to try this:
1) Comment out the textarea and its label in the
form.php
file.2) Enter permanent text in it (i.e., “Not Used”) so it’ll meet the requirement.
3) Turn off the CC option because the email won’t read as naturally.
This should satisfy your needs.
Monika@The Writers Manifesto responds:
Posted: January 16th, 2008 at 8:46 pm →
Hi Mike,
I did all you said, checked my CHMOD and they are both 755 in both blogs. I then downloaded your recommended plugin, unzipped it and uploaded it into the plugin folder on my server.
I go to the admin - plugins (trying to activate) and all there is is nothing - nadda!
What next? I’m getting really desperate and everywhere I turn, nobody knows the answer.
Monika
Mike Cherim responds:
Posted: January 16th, 2008 at 9:24 pm →
I don’t know Monika. This isn’t even related to this contact form script anymore. You really need to ask in the WordPress support forums. Sorry.
Sammy responds:
Posted: January 17th, 2008 at 8:13 am →
Hi. I’ve followed your advice for hiding the textarea. Commenting it out didn’t work, as the default content that I added wasn’t even submitted, so I got an error. So instead I used css (position absolute) to hide it (and its label) from view, like the honeypot. That way it’s invisible, but still gets submitted. Works fine.
I also added tabindex=999 to that hidden textarea, so that tabbing just goes from one visible field to the next. And I added tabindex=1000 to the honeypot, to be able to tab straight from the last visible field to the submit button. Maybe that last bit could be an idea for improvement of your script ?
Thanks for your work.
Tim responds:
Posted: January 20th, 2008 at 7:02 pm →
I was thinking, is it possible to adapt this to a questionnaire form, so that you can have custom questions. I’m thinking in terms of a client questionnaire for a web design business maybe 20 questions or less.
I’m guessing form.php is where i’de need to start but where else would need to be edited to create custom input fields with textareas?
Mike Cherim responds:
Posted: January 20th, 2008 at 7:38 pm →
Hi Tim. Some of the inputs can be changed, but to offer a large number of added questions, to do it right, you’d edit the
form.php
andfunctions.php
files, and you also edit your language file of choice (append the language file as this will be much easier than incorporating the added label/email text in the right sections. That’d be about it. The majority of the script additions would be in the functions file (there will be a lot of them, mostly a copy-and-paste and variable rename tasks — not difficult if care is taken — but it must be done precisely so a decent understanding of PHP to the point of understanding what’s going on in the script will be very helpful). If you’re at all nervous about it, make your edits in bits, check your error log, and save copies along the way so you have a back-up.dbj responds:
Posted: January 24th, 2008 at 7:05 am →
as always an excellent item.
not quite sure what i would do without this superb contact form.
a big thankyou from all the members of my two sites who easily use this form to repart problems
Mel Pedley responds:
Posted: January 25th, 2008 at 11:58 am →
I’ve just had a very similar problem to Stuart’s. In my case, I couldn’t get the form to display my customised thank you page. It persisted in using the default message and re-displaying the form. Like Stuart, the site that I’m using to try out this new version of the form has its own header files etc. As soon as I saw the
header()
call in the functions file, I figured this might be the cause as header() must be called before any actual output is sent. Both Stuart’s pages and mine have already sent output via included headers so a call to header() will either generate an error or cause the url call to silently fail.The solution? Add
ob_start();
to the very top of any PHP page being used to call the form andob_end_flush();
. That will buffer the output and allow theheader()
call. At least that’s worked for me.Incidentally, in the documentation, you describe the
$thankyou_url
as being “relative”. But relative to what? eventually, I figured out it was relative to the site’s root directory but you might want to clarify that.Mel Pedley responds:
Posted: January 25th, 2008 at 12:03 pm →
Sorry - edit:
Add
ob_start();
to the very top of any PHP page being used to call the form andob_end_flush();
to the very end of the page.Mike Cherim responds:
Posted: January 25th, 2008 at 12:43 pm →
Thanks Mel. I actually fixed that the other day. I think so anyway. I was considering using
ob_...()
functions but found another way. As far as I know if the warning isn’t triggered it’ll work as expected without harm so I just killed the warning on theheader()
functions with@
(I considered using theerror_reporting()
function but I tried this first). If you will, can you try that to see if it works… if not, I’ll just add your solution to the help page. Trying to avoid people having to do anything — unless I add that to the form file but I don’t think that’ll work.Regarding the relative URL issue, I do explain that in more detail on the included help page.
Mel Pedley responds:
Posted: January 25th, 2008 at 1:05 pm →
I’ve just been doing some more testing on the live site and
ob_start()
isn’t the answer. I ended up being re-directed to the thank you page after trying to submit an empty form! So much for output buffering.I’m not concerned about the fact that I’m not getting a PHP error. Recently, I’ve been tending to turn error reporting off via script or .htaccess on Apache unless I’m actively debugging something. And the script does work just fine - except it refuses to show my thank you page. I’m just frustrated that I can’t find a way around this when I’m willing to wager that it’s a header issue. Would an include be an option instead of a header call (though that would mean supplying header and footer files for sites that don’t have these files as standard)?
I’m also going to see if I can find a way of including the form before my header files which would circumvent the problem.
With regard to the help documentation, I did read both help files but still felt a little unsure about the correct relative path to use. Perhaps it’s just me? When I write up script documentation, I always try to be specific and tend to say “relative to your site’s root directory” or “relative to this file”. If there’s one place people do seem to routinely have problems, it’s in regard to file paths.
Mike Cherim responds:
Posted: January 25th, 2008 at 1:13 pm →
Thanks Mel. I’ll try to address the clarity issue maybe by putting an example or more text in the config. I try to be brief in that file.
Regarding the redirect issue, I haven’t been able to replicate it so I haven’t been able to roll up my sleeves and test. Maybe what I should do, instead of redirecting, is to use that to include content on the same page and not show the form. If I could replicate the error it’d sure be easier.
Longhair responds:
Posted: January 28th, 2008 at 10:20 am →
I was wondering if there is a simple way to have people enter their own subject instead of using the drop down menu?
Thanks again for everything
Mike Cherim responds:
Posted: January 28th, 2008 at 10:34 am →
It could be done. You’d swap out the select for a text input, add a length variable for it, kill the subject array, and you’d have to comment out the special security feature for that element (if it’s not in the array it’s not valid). Doable, and not too hard, but not for everyone. I would have done it like that initially, but the menu leads to a good security feature so I didn’t want to pass it up.
Barry Hurford responds:
Posted: January 28th, 2008 at 4:33 pm →
As a fairly traditional ‘ladies man’ - It’s not often that I shout out loud “I LOVE YOU MIKE!” but that is exactly what happened today, 10 minutes after I installed this beauty!
This contact form is extremely well thought out and executed. It is clean, secure and readily configured using the CSS theme and CONFIG file.
If you are here in search of a professional PHP contact form then rest a while my friend for you need wander no more…
Incidentally, I clicked the DONATE button earlier and there was a definite feeling of good karma about it - I would like to suggest that those of you who find Mike’s work useful click on the DONATE button too - it is life enhancing!
Thanks Mike - your gift of well formed coding is well received :O)
Mike Cherim responds:
Posted: January 28th, 2008 at 4:48 pm →
Thanks Barry
Andy responds:
Posted: January 30th, 2008 at 6:56 am →
Thanks Mike, another great piece of work. A few additional text fields and option menus (optional) would hugely increase the opportunities for deployment. Removal of tag means page now validates! I’m hoping to be able to send you a Welsh translation soon.
Mike Cherim responds:
Posted: January 30th, 2008 at 10:17 am →
Hi Andy, I may run with your suggestion to add a couple more inputs, a textarea, and maybe some radio buttons (even though it means asking for some language file additions from the translators. Looking forward to getting the Welsh translation.
Current languages available: en, be, fr, ru, no, en-gb, en-us, nl, es, it, da, fi, ro, en, ja, sv
Cody responds:
Posted: February 3rd, 2008 at 4:40 pm →
First off….this is by far the most complete and well built php form i’ve found online. The one thing i notice is that in Safari if the user doesn’t fill out the form right they are brought to the “error” page. On that page is says to use the “back” button to go back to the form to fill out all the required fields. I’m using Safari 3.0.4 and when you click the back button it doesn’t go back to the form page…..it just stays on the “error” page. Any thoughts?
Mike Cherim responds:
Posted: February 3rd, 2008 at 5:56 pm →
You shouldn’t need to hit the back button on this form version, Cody. If there is a form error the form is on the same page and all the data is retained. That help?
Cody Silva responds:
Posted: February 3rd, 2008 at 7:06 pm →
Hmm….weird. I tried it again in Safari 3.0.4 and if i don’t fill out anything on the form and hit “submit” i get to the page stating…”Results: Error Made!
Required Field(s) Missed: The following “Required” fields were not filled in. Using your “Back” button, please go back and fill in all required fields.
Empty Field(s):
“Enter your full name”
“Enter your email address”
“Select a contact reason”
“Enter your message”
“Enter 6315”
…there is nothing else on the page (no form below this content). When i hit the browser back button it stays on this “Results: Error Made!” page but the url reflects the PHP contact form path. I also tried this with the contact form on your site and it does the same thing in Safari. It works fine in Firefox. Oh and this is all on a Mac.
Cody Silva responds:
Posted: February 3rd, 2008 at 7:36 pm →
I think i had version 2 of the form…..I just downloaded v.3 and will try that.
Steve Butler responds:
Posted: February 4th, 2008 at 2:24 pm →
Mike,
Looking like the best contact form I’ve found so far
Have not yet found anything that does not work as stated, one thing I’d like to be able to do, but I have no php experience is to have default message text matched to the subject selection i.e. 4 subject options with corresponding 4 default message text entries.
For me, this would move it from Brilliant to Stunning!
Steve
Steve Butler responds:
Posted: February 4th, 2008 at 2:32 pm →
Donation on its way!
How do I make the subject drop down list form field display box longer? it does not show all the text in IE7?
Mike Cherim responds:
Posted: February 4th, 2008 at 2:41 pm →
Hi Steve, what you’re looking for regarding the message text, I suppose that could be negotiated by PHP select = this then message = that, but that’d have to be hard-coded in. And I imagine you wouldn’t want to text area to show since you’d be pre-populating it.
Regarding the select, just look for
select
in the style sheet and adjust the width property. That should be pretty straight forward.Steve Butler responds:
Posted: February 4th, 2008 at 4:13 pm →
Doh! found the select - having a blind moment.
On the message text, it would be nice if it could be done using the config file and another array, but having never done any php… might give it a go if I have a free week soon
Cheers
Mike Cherim responds:
Posted: February 4th, 2008 at 7:11 pm →
Hi Steve, maybe I’m not understanding what you want to do properly, but to script in and put that in the config somehow (an associative array of massages included once the form is submitted based what menu item is picked by the user?), would be a lot of work, and additional steps and confusion for other users, but I don’t see it having the matching benefit of pots of users needing/wanting a feature like that. A bit of a conundrum.
Stephen Anderson responds:
Posted: February 5th, 2008 at 1:44 am →
Hi Mike,
Firstly thanks for this plugin. I am definitely a novice when it comes to this stuff. I managed to change the config file and then upload the file and test it. It all works fine it seems.
I have three different blogs. I uploaded the GBCF-v3 folder to my public_html directory. I am wondering if that was the right place to put it? If so, how do I get it to work on my desired blog. Do I need to now move it to the wp-cotnent ==>Plugins directory ?
I hope it is not too simple a question
Thanks,
Steve.
Mike Cherim responds:
Posted: February 5th, 2008 at 2:04 am →
Hi Steve. This version is not yet a WordPress plugin so you won’t be able to use it on a blog. Even if you make a template it’s still not ready for WordPress (I tried that today actually). I do have a WordPress contact form though if you want to use that.
Alex responds:
Posted: February 9th, 2008 at 1:02 pm →
Hello Mike, thanks for the great script…
I first set it up locally but when I set it up on the server this is what I get http://www.awholeuniverse.com/index.php/contact
I have looked through the functions file and the config file and everything is as it should be.
Thanks a lot for your help!
Mike Cherim responds:
Posted: February 9th, 2008 at 2:39 pm →
Hi Alex. Looks okay to me. You’re using me and Mike Jolley’s contact form plugin. Is there’s something broken?
Isaac Rowntree responds:
Posted: February 10th, 2008 at 4:17 am →
Hi Mike,
First off, I really liked your Contact Form v2. So much in fact, that I released an e-commerce plugin for Wordpress that included a way to tie in to your Contact Form for sending off orders.
http://wordpress.org/extend/plugins/quick-shop/
This would have increased your download margin significantly, I bet.
However, I have since come up against a bit of a brick wall. I want to support 3rd party payments like Paypal in Quickshop while still being able to use a form so that customers can get a receipt and shop owners can be notified.
This is where your v3 form would be really good. Since you are actively developing it we could possibly collaborate and make it so that they were still seperate plugins, yet could hook into each other extremely easily.
I’m a little unsure how that would work, but it’s certainly something to consider. At the moment I’ve been trying t o add a contact form to my plugin and in my view it’s both messy and unnecessary. If your v3 plugin supported adding extra fields easily via an admin interface much like CForms II, allowed the sending of a receipt in some way, and output the contents of the shopping cart easily into the main text body, it would be awesome. I believe there should be any easy-enough way to do this via a kind of API so that down the track other developers could hook in also.
At the moment I use PHP sessions to store form data… this may need to be changed or finalised.
Eagerly awaiting your response,
Isaac
Alex responds:
Posted: February 10th, 2008 at 4:38 am →
Hey Mike…. I switched to “Secure and Accessible PHP Contact Form v.2.0WP” however I know that until this point there is no possibility of excluding some fields from the form(like let’s say telephone or reason).Do you have any updates on that? I tried to change the php file but even though I exclude the fields the script checks for the fields excluded and I get an error message. Do you know any workaround?
Thank you!
Mike Cherim responds:
Posted: February 10th, 2008 at 4:57 am →
@Isaac: In a nutshell my plan is to add interface files that will be supplied with the same script for all platforms. They will be included based on whether or not custom, platform-specific function exists. If it does, a back-end will be loaded after the config but before the functions file automatically. That file will tie into the existing environment. Example: I some WP function exists, load the WP interface file. It’ll be slick. I haven’t thought any more on it at this point though. v3 needs to be shaken down a lot more before that step.
@Alex: To get rid of the optional field in v2 you can just comment them out. It’s that easy. To get rid of the required fields, though, would be trickier. The file, however, is commented so if you break it down, step-by-step, you should be able to make sense of it enough to pull out what you want.
Alex responds:
Posted: February 10th, 2008 at 6:25 am →
There seems to be another error
“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 my regular email, [email removed], to circumvent Referrer Mismatch.”
Do you know what might have caused this?
Mike Cherim responds:
Posted: February 10th, 2008 at 10:31 am →
@Alex: That error would result from a need to change the last section of the config. There are instructions in the config file. The form location is the URL of your contact page. The script can determine this on its own, but not always. Just so you know, this blog post is for the support of my version 3 form. For version two support you should comment to that post, please (and there’s one for the WordPress version too). Thanks.
Alex responds:
Posted: February 10th, 2008 at 12:55 pm →
THANK YOU … it worked !!!!
Adam responds:
Posted: February 10th, 2008 at 10:49 pm →
I just installed V3 of the script on my website. Script works great, and was a million times better then the 3 field contact us form I had created last year.
Leonard responds:
Posted: February 17th, 2008 at 12:43 pm →
What a great script! I needed it to be able to send to different folks, depending on the link, so in CONFIG.php I replaced
$send_email = "foo@foobar.com";
with
So now at URL of
mail.php?to=Foo
works.I don’t know much about security, though — have I compromised anything with this?
Mike Cherim responds:
Posted: February 17th, 2008 at 1:10 pm →
That’s great Leonard. Thanks for sharing. The inputted variable is still sanitized so there shouldn’t be any security-related issues — that I am aware of.
(I put your script in a
pre
and converted the entities so people can cut and paste it if they want.)Susan responds:
Posted: February 18th, 2008 at 6:59 am →
Hello Mike,
Thanks a lot for that great contact form!
I was able to succesfully install it. And the testform is working good and I recieve the email, but I am so new to php that I cant figure out how to do step 9 in the installation process:
“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.”
Do I have to make a php page contact.php and put the php include code in as only content? When I try so, I get an error:
———
Warning: main(gbcf-v3/form.php) [function.main]: failed to open stream: No such file or directory in /home/.sites/106/site123/web/testing/gbcf-v3/contact.php on line 2
Warning: main() [function.include]: Failed opening ‘gbcf-v3/form.php’ for inclusion (include_path=’.:/usr/lib/php/’) in /home/.sites/106/site123/web/testing/gbcf-v3/contact.php on line 2
————
As I said, I am new to php and appreciate any help very much!
Mike Cherim responds:
Posted: February 18th, 2008 at 9:20 am →
Hi Susan. Yep, you want to create a contact page and add to its head the link to the style sheet and the JS focus file, and the include. If you’re getting that error you need to alter the path within in that include function so the file is found. /gbcf-v3/form.php, ../gbcf-v3/form.php, etc. All depends of the file location.
Jen Rohrig responds:
Posted: February 19th, 2008 at 9:42 am →
I just added the form to my Accessible Design site - it’s really cool. I think what I like most about it is the form code is all nicely contained in one area and all I needed to do was add a few links to it. PHP programming is my weak area - something I’m trying to fix but it’s slow going. Just not a programmer at heart.
laura responds:
Posted: February 28th, 2008 at 4:02 pm →
Hi Mike
Thanks very much for your script, it’s great one!!
I was setting up the contact form on a horizontal page, using horizontal tiny scroll javascript from Marco Rosella -http://www.thehorizontalway.com- but when I click to the submit button all the page is moving to the left side…. I was trying to find the function to fix that in the fuctions.php file and in the other files but I couldn’t find it, I have been stuck with problem for a while …. could you help me?
One more thing, I noticed that the spanish language file is writting in LatinAmerica Spanish and very formal way, different to the spanish we talk on Spain, so I don’t mind to send you a file with an extra version for spanish on spain (castellano), just only few words are different.
Thanks
Mike Cherim responds:
Posted: February 28th, 2008 at 5:40 pm →
Moving horizontall (yuk)? To the
#results
bookmark? I don’t really understand.Regarding the Spanish file, by all means, that’d be great. Curious, would the ID be the same (so I could have both)? Thanks.
laura responds:
Posted: February 28th, 2008 at 7:18 pm →
Mike
thanks for your answer… yes, horizontal … I was trying with the #results… but I didn’t manage to make it work.. it’s still jumping…
http://www.pablogoikoetxea.com/main.php#fourth
Regarding the Spanish file, yes, I rename the new one as es-sp (español-spain).. ?!
just let me know how it will be the best way to send to you, through a link from my server or by email
thanks
Mike Cherim responds:
Posted: February 28th, 2008 at 10:09 pm →
Hi Laura, I just tested it and it seems to work just fine. I did note the result doesn’t allow the form to be centered, but that’s because it’s jumping directly to the beginning of the message. Maybe, to center it more, you could apply some negative left margin to that message box and that might result in centering the form on submit a bit more. Aside from that, though, it seems to work fine. I tested the form, once for success (got the copy) and once for error.
I noted the error didn’t record, but I know why. Just upgrade to most current build. Should involve nothing more than swapping out the functions.php and form.php files (and change directory if you did that). The other files were upgraded too, but I doubt you need those now. That will fix the stats.
I hope this helps. Nice form layout… I like.
To send the language file, just add it as an attachment in a reply to the mail I just sent you. Thanks for the info about “es-sp” — do you know if the other “es” file should have something added to the name?
laura responds:
Posted: March 1st, 2008 at 11:08 am →
Hi Mike
Thanks for the testing. I though I upload the last functions.php and form.php files…. I will do again
I was using negative margins before and It didn’t work, I will trying again..
Sorry for the delay to send you the “es-sp” file, just waiting for my friend send me your email… as that contact form is going to my friend email - I set up that contact form for him, Pablo Goikoetxea’s website-. As soon as I get your email I will send to you the file.
About if the other “es” file should have something added to, I think it will fine just as “es”, as the other one will be name “es-sp” that it will make a specifications about this spanish version, the other one, even it’s more latinamerican spanish, it’s fine named as it was.
Thanks for your help
Mike Cherim responds:
Posted: March 1st, 2008 at 11:52 am →
Thanks Laura. I’m hoping to get a DE (German) language file very soon so maybe I can get them all in place for the next build. My email is mikecherim (one word) at this domain.
Mark responds:
Posted: March 17th, 2008 at 12:25 pm →
Getting an error like below:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../../gbcf-v3/files/CONFIG.php) is not within the allowed path(s)
Is there a way to get this working when a host has safe mode on like shown above? (I know, it’s a hosting problem with their configuration but as this is shared hosting not likely they will change things.)
Mike Cherim responds:
Posted: March 17th, 2008 at 12:58 pm →
Have you asked your host or tried moving the folder up? I really don’t know because I’m not really familiar with the problem.
dean responds:
Posted: March 19th, 2008 at 11:20 am →
Hi Mike- Great form here. I was trying to install the script on my site here; http://apatalk.com/rates.php, but I get two error messages. Any help from your busy schedule would be appreciated.
Regards,
Dean
Warning: main(gbst/form.php) [function.main]: failed to open stream: No such file or directory in /home/apatalk/public_html/rates.php on line 25
Warning: main() [function.include]: Failed opening ‘gbst/form.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/apatalk/public_html/rates.php on line 25
Mike Cherim responds:
Posted: March 19th, 2008 at 12:01 pm →
Hi dean, your
include()
used to bring the form onto your page is wrong so it’s not finding the file. This could be because you need to change the include to find the file, or, and maybe this is it, I noted this:gbst/form.php
. Intentional? Should be this normally:gbcf/form.php
.dean responds:
Posted: March 19th, 2008 at 12:44 pm →
Mike- I’m not sure what I did, but apparently it works now. I’m still using the same line of code that is found in your readme.txt file. It says to include this line of code into the body of the page;
The only thing that I tried was inserting this into the head part of my page and then back into the body area and now it works. Strange. Not sure if you know why? Helpful to know for future reference. Thanks again.
dean responds:
Posted: March 19th, 2008 at 12:45 pm →
Oops, the comment box doesn’t allow for php code. Let me try it this way;
//
dean responds:
Posted: March 19th, 2008 at 12:46 pm →
Damn. Not sure how to include php code into this comment form. Well, hopefully, you might know what I’m referring to. If not, just email me.
Mike Cherim responds:
Posted: March 19th, 2008 at 12:55 pm →
To post code you have to convert the characters:
To publish this
<code>code<code>
, you’d write<code>code<code>
. But that’s okay, you got it working.Gill responds:
Posted: March 22nd, 2008 at 8:49 am →
With regard to Stuart’s problem
This can sometimes be caused by spaces at the beginning or end of the PHP file. It can also be the result of using an editor which attaches a Byte Order Mark (BOM). The UTF-8 representation of the BOM is the byte sequence EF BB BF, which appears as the ISO-8859-1 characters “” in most text editors and web browsers not prepared to handle UTF-8.
When I see that warning, the first thing I do is open the file up in a text editor which recognises Hex characters, I use UltaEdit, and make sure there are no odd characters on the front of the code, no spaces on the front of the code, no spaces or blank lines at the end of the code. If there are, remove them.
I then save as UTF-8 No BOM. Nine times out of 10 that fixes the problem.
A lot of people try to edit the files in FrontPage, Expression Web, CoffeeCup or other non-pro packages. That’s when you get the BOM added. MS have admitted they crippled EW with regards to PHP but I’m told version 2 will handle it.
Mike Cherim responds:
Posted: March 22nd, 2008 at 10:01 am →
Thanks for that Gill. I knew about white spaces causing problems but didn’t made the connection. I will sure to check my files during the next build. I try to avoid that, but it sometimes gets through. Goo to know about the characters especially. I had a user of my WP plugin have those on their blog, before the form, from edits they made, but I couldn’t explain the characters.
Tim responds:
Posted: March 22nd, 2008 at 1:42 pm →
Great work, Mike! I’ve used your WordPress plugin for some time now, and it works great! Now, to my problem
I loaded up this new version of the contact form for my non-WP site (the URL provided), and everything was fine. Suddenly, the PHP function scandir() stopped working on my site! Zoiks! I perused the previous comments, but didn’t see anything that looked like it would fix my problem. I’m no PHP guru, so maybe I’m missing something.
The error is:
Fatal error: Call to undefined function: scandir() in /home/content/t/i/m/timjamz/html/storytribe/just4fun/1.php on line 4
I’m using scandir to check the contents of the directory for the number of files present (for dynamic navigation of the webpage)… I don’t want to use readdir, since it modifies the “accessed” time of the files. For example:
$nextcomic = ($comicid + "1");
$prevcomic = ($comicid - "1");
$dirarray = scandir("just4fun/");
$dirarraynumber = count($dirarray);
$lastcomic = ($dirarraynumber - "2");
The contact form scripts don’t modify any globals, do they??? I contacted my web host, and they insist they haven’t changed anything. It was working fine yesterday and this morning before using the contact form. Thanks for any help/guidance you can provide!
Mike Cherim responds:
Posted: March 22nd, 2008 at 2:10 pm →
Hi Tim, I really don’t know what it would be. There are indexes in the directories included with the form, and these have only the
die()
function with a heading as the output (saying the directory access is denied), but that shouldn’t affect the function you’re talking about since that would open the file and should just see the index as well as any other files. No changes to globals in the script.What the error is telling me is that the function used to be found and isn’t anymore, which would be indicative of the function no longer being present (defining script moved or missing), or somehow the path to the script has been altered, but nothing about the form that I can think of would have any bearing on either. Sorry. If you find the form scripting is somehow related, please let me know how and I’ll gladly fixed the issue.
Tim responds:
Posted: March 22nd, 2008 at 3:11 pm →
Mike, thanks for the quick response! I’m not sure if the contact form had anything to do with this or not (again, I am no PHP guru). Maybe it’s just a coincidence that this happened at the same time as installing the contact form.
However, this may help someone else someday.
For some reason, *.php files on my host (GoDaddy… I know, I know…) were suddenly not associated with PHP5 processing anymore (aka reverted to PHP4 as default). I had to add the following lines to my .htaccess file for *.php to go back to PHP5 default processing:
AddHandler x-httpd-php5 .php .php5
AddHandler x-httpd-php .php4
Anyway, all is well after doing this…. and the contact form works great!
Mike Cherim responds:
Posted: March 22nd, 2008 at 4:22 pm →
That’s cool. Though strange as the form should be at home with PHP 4 or 5 (it needs a single function change that I know of to make it PHP 6 compatible). Thanks for the update, Tim.
Tim responds:
Posted: March 22nd, 2008 at 4:39 pm →
Indeed, the form worked flawlessly. My pages were what failed… just wanted to clarify that. Maybe something in the form notified my host’s servers that my files weren’t being processed in v5 native…. or it may have been some big whopping coincidence. Again, thank you!
Mike Cherim responds:
Posted: March 22nd, 2008 at 5:00 pm →
Thanks for clarification. Glad all’s well now
Gill responds:
Posted: March 23rd, 2008 at 8:41 am →
Tim, suspect Godaddy. I’ve had 3 different hosts make some changes to PHP over the past 3 months, on 7 different servers and each one has got it wrong. Apart from 4 client sites where the includes just vanished, all the others were showing completely different problems and had me climbing the walls.
Gill responds:
Posted: March 24th, 2008 at 10:08 am →
I’m in the process of helping someone who is trying to install this form and they’re having all sorts of problems. It’s not the fault of Mike or the form but something I thought I should raise here. Mike, you might like to add something about it to your install info.
You cannot edit the files or upload them using FrontPage or Expression Web Version 1. I suspect you may also get problems if you’re using Blue Voda, CoffeeCup and various other WYSIWYG editors. These bits of kit are meant for making quick web pages with HTML not PHP.
If you normally use these tools I suggest before you start with this form you download UltraEdit which is free and will allow you to modify without corrupting.
You will need to upload using an FTP client such as Filezilla not (PLEASE NOT) FrontPage Publish. However, if you normally use FrontPage and have the FSPE (FrontPage Server Extensions) active on your hosting account, FTP will corrupt them. You have two choices.
If your host gives you control over FPSE then you can upload with an FTP client, then reinstall your FPSE
or if that isn’t an option,
log onto your host control panel and use their File Manager to upload which should not corrupt anything.
Mike Cherim responds:
Posted: March 24th, 2008 at 11:58 am →
Thanks Gill. I do have the warning in several places, including the readme, to edit in a plain text editor. Didn’t know that about FTP though so I will add that (or a link to this) in the FAQs. I use Cute FTP so that’s another good one. Thanks for the heads up about FPSE (it figures anything with FP in it wouldn’t be good).
Help page updated.
Gill responds:
Posted: March 24th, 2008 at 12:43 pm →
Problem is Mike, to many non-pros, FrontPage code view is a plain text editor. They open it, they get text, not pictures. You may need to spell it out.
Gill responds:
Posted: March 24th, 2008 at 12:50 pm →
Other way round. Using FTP to upload corrupts the FPSEs. It won’t affect your form or any PHP stuff loaded but the site, if it uses FrontPage bots such as Gallery, will fail spectacularly
Mike Cherim responds:
Posted: March 24th, 2008 at 12:53 pm →
I do specify not to use things like Dreamweaver and mention NotePad and TextPad as being okay. Some people just need it done for them
Gill responds:
Posted: March 24th, 2008 at 1:18 pm →
:-)
JBVisions - reasonable rates - sympathetic ear - great with Mike Forms. LOL!
Mike Cherim responds:
Posted: March 24th, 2008 at 1:41 pm →
Hehe.
Dogs and things responds:
Posted: March 25th, 2008 at 3:16 pm →
Hi Mike,
I just drop by to let you know that I´m impressed by your latest version. I was using v2 on one site but when trying to install it on my main site I ran into troubles. Fortunately it ocurred to me to check out your site and surprise surprise I found your new version.
What a huge improvment you have made, brillantly done, it´s so much easier to configure, style and manage.
As I feel such great work can´t be free I just gave your donate-button a tiny touch.
Thanks a lot Mike, good luck.
Greetings from Spain,
Willy.
Mike Cherim responds:
Posted: March 25th, 2008 at 3:47 pm →
Thanks Willy
Dogs and things responds:
Posted: March 25th, 2008 at 4:19 pm →
My pleasure Mike.
Carl responds:
Posted: March 28th, 2008 at 6:23 pm →
Hi there,
I installed your script today and I am very impressed. It seems to work perfectly, and is very flexible.
Thanks for all of your hard work. I do have a question and was wondering if you had any thoughts on this application. I have a client with a company directory of names and contact emails. This leads to a huge amount of spam to the employees of the company. Could this form be setup to have a drop down field with the employees name so that the request could be sent to that corresponding email address ?
As I was playing with it it seemed doable but my php skills are fairly green and probably beyond my capability. It seems that this would be an excellent option to have.
cheers
Carl
Mike Cherim responds:
Posted: March 28th, 2008 at 6:57 pm →
Hi Carl. I do plan to add such a feature on a commercial copy of this form version (like the commercial copy of my WordPress version). It hasn’t been done yet, though. So, it is possible, but it is rather involved. Sorry.
Carl responds:
Posted: March 29th, 2008 at 12:48 pm →
Thanks for the reply Mike,
Count me in on the first person to buy the commercial version with this feature.
Carl
Paul responds:
Posted: April 14th, 2008 at 11:12 am →
A quick question - are the emails stored / backed up anywhere by default?
Mike Cherim responds:
Posted: April 14th, 2008 at 11:35 am →
@Paul: Nope. Right to the mail server.
Brian Lokker responds:
Posted: April 18th, 2008 at 10:27 am →
Mike, I’m trying the v3 of the form and it looks great! I set it up on my local development server using MAMP and it works perfectly. When I upload it to the live server, the validation page runs successfully, but when I try to process the form, I get a “page not found” error. I checked the source code and discovered that the form action path includes an extra directory level. So instead of “/contact/test-form.php#results” as it should be (and as it is on my local development server), it is “/[extra_directory]/contact/test-form.php#results.” I checked with the web host and they confirmed that the site is installed in a subdirectory of the server. So my question is whether it is possible to modify the form so that the start path is “/[extra_directory]” rather than the top-level directory of the server. The web host may agree to move the site if I need them to, but I thought I’d see whether there is a relatively easy fix on the form. Thanks in advance.
Mike Cherim responds:
Posted: April 18th, 2008 at 11:02 am →
If you go into the form.php and functions.php files (as the minimum) just change the
$set_directory
variable toextra_directory/contact
assuming contact is the new name for thegbcf-v3
folder. You can also edit the form action in the config file, but you shouldn’t need to do that once you make the other change. That help?Brian Lokker responds:
Posted: April 18th, 2008 at 12:21 pm →
MIke, thanks for your very prompt response.
Unfortunately, editing the variable in the form.php and functions.php didn’t do the job. The form action path was still wrong, and other paths were thrown off too (e.g., to the focus.js file).
You mentioned editing the form action in the CONFIG.php file. Right now it’s blank. What would I change it to so that the extra “top-level” directory is eliminated from the path?
Brian
Mike Cherim responds:
Posted: April 18th, 2008 at 12:30 pm →
Hi Brian. You could just add a pound sign…
#
that should do it. For testing the form, if you do the thing I mentioned about the path above, that$set_directory
variable is also in the test-form, help, and validation pages, so for testing those will need to be done too. I had just given you the info needed for the live form. All of this info is on the help page by the way, on the variables list and in the FAQs.Brian Lokker responds:
Posted: April 18th, 2008 at 1:02 pm →
Thanks again, Mike. I’ll experiment some more.
I checked the help page but I didn’t think the variable renaming applied because I didn’t actually rename the gbcf-v3 folder - I just placed it within the “contact” directory which I thought (erroneously) was at the root level.
Anyway, I’ll see what happens.
Brian
Mike Cherim responds:
Posted: April 18th, 2008 at 1:41 pm →
I see, then
$set_directory
will have to beextra_directory/contact/gbcf-v3
.Brian Lokker responds:
Posted: April 18th, 2008 at 1:56 pm →
Mike,
I added the pound sign to the form action, and the form submission works as a result. However, that seems to interfere with the page reset function. On balance I think my better course is to get the site moved to a top-level directory.
Brian
Mike Cherim responds:
Posted: April 18th, 2008 at 2:42 pm →
Ah, yes, that’s right. You could also trying setting the action to
extra_directory/contact/contact.php
(this assumes your contact page is contact.php, and you might have to add a leading slash (or full URL). That should make the form submit and allow the reset to work. Sorry about that, I forgot$form_action
also serves as a reset link.Brian Lokker responds:
Posted: April 18th, 2008 at 4:15 pm →
Good call, Mike! Before getting the site moved, I tried setting the action to the full URL, and it worked like a charm! Thanks for all your help with this. (Donation on the way.)
Brian
Mike Cherim responds:
Posted: April 18th, 2008 at 4:49 pm →
Sweet …and thank you for the contribution.
Mark Fleming responds:
Posted: April 19th, 2008 at 10:54 am →
Does this record the IP address of the contact form user and send it to me along with the message?
Mike Cherim responds:
Posted: April 19th, 2008 at 11:16 am →
Yes. It also includes a convenient whois link. An example of what you get is shown in the FAQs (scroll down).
Mark Fleming responds:
Posted: April 19th, 2008 at 11:25 am →
NIce, thanks.
One more question: does the email come to me with the “from” address of the user who filled out the form, so I can easily just click “reply” in my email program?
Mike Cherim responds:
Posted: April 19th, 2008 at 11:38 am →
Yes. All my forms do that actually, even though v2 and v2WP don’t “look” that way.
Gerard Bulger responds:
Posted: May 5th, 2008 at 7:13 am →
very very good indeed. Worked out of the box and thanks and credit of course. Spam has stopped, as I had problems ++++ with my old script.
The only thing I want to do is change the phrase “check for email copy” at the bottom of the form, as in UK English and the less savvy that needs to be something like
tick the box to get an email copy for yourself. I cannot find the original line on your script to edit.
Gerry
Mike Cherim responds:
Posted: May 5th, 2008 at 8:52 am →
Hi Gerry, It’s in the language file you’re using. Just edit with a text editor and don’t change the file formatting.
Carl responds:
Posted: May 12th, 2008 at 12:15 pm →
Hi Mike,
I installed PHP 5.2.5 and Mysql on a Vista Ultimate machine. I have been running your script on my clients site with no problems accept 1( I will ask you about this later) but when running it on the local server I get this error.
Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not in a.b.c.d form in D:\local_marinelink_ca\gbcf-v3\files\functions.php on line 722
Warning: mail() [function.mail]: SMTP server response: 502 negative vibes in D:\local_marinelink_ca\gbcf-v3\files\functions.php on line 1132
But I do get a “Success email sent Results.”(no mail sent though of course)
I know it is probably the settings I have in the IIS manager or PHP install but was curious if you may have some insight.
If not I will scour the technotes on IIS7 and PHP.
regards
Carl
Mike Cherim responds:
Posted: May 12th, 2008 at 1:30 pm →
Hi Carl. All I can think of is normal functions not available on a local installation. I’m thinking none of that will manifest once on a web server. I’m not sure, though.
Shane Mitchell responds:
Posted: May 15th, 2008 at 6:07 am →
The email address validation doesn’t allow the + character. According to the RFC for email addresses the + character is valid and a lot of people are now using it with GMail when giving out their address to websites.
Mike Cherim responds:
Posted: May 15th, 2008 at 6:44 am →
Thanks Shane. I’ll have to change the allowable expressions.
michael responds:
Posted: May 22nd, 2008 at 3:49 pm →
hey why don’t you put a line in the config file to switch themes more easily.
Mike Cherim responds:
Posted: May 22nd, 2008 at 5:12 pm →
Because the form is standalone. If I did that then I’d have to add scripting to the head of the site.
Bell responds:
Posted: May 22nd, 2008 at 10:52 pm →
Help!
My form will not direct to my thankyou url. My contact.php that calls the form is in the public_html folder, so is my thankyou.html page. But the form reloads itself after submitting. I tried the fix above putting ob_end_flush();. at the very end of the contac.php and ob_start(); at the very top of the page and they showed up as text on the form page. I entered my thankyou_url as /thankyou.html and tried it without the slash and none of this works.
How can I get this to work?
Mike Cherim responds:
Posted: May 22nd, 2008 at 11:32 pm →
I’m afraid that matter hasn’t been resolved. Some people have issues with it and some do not. I think it all depends on the type of site, static pages versus a PHP site or one that uses templates and a database, and/or specific includes security setting on the server. I would ask your host, post in some forums like Site Point, or something along those lines. I do not know the answer. Sorry.
Alternatively, with some creativity in the language file of choice and just a little bit on style sheet work, you could offer a pretty complete Thank You message with the default configuration, on the same page. It doesn’t have to be a one-liner. I mean it is designed to offer you some control over it — such as offering users a specific
class
as a styling hook. Bear in mind the language file for the success message in on more than one line. You will have to work around that. I know someone who did this, though, and what they did was really quite good. They were happy. Check it out.Bell responds:
Posted: May 23rd, 2008 at 4:46 pm →
Thanks for your reply I appreciate it.
I noticed that it works with the test-form.php, Does that offer any clue, or perhaps things I could try. I’m a php newb.
Bell responds:
Posted: May 23rd, 2008 at 4:50 pm →
… also, I changed the code in my contac.php page in the include line from “form.php” to “test-form.php” it didn’t work and just refreshed the test-form page after submition.
So the problem has to do with that include line maybe…
Any thoughts?
Mike Cherim responds:
Posted: May 23rd, 2008 at 5:29 pm →
The test form itself includes the form.php so I wouldn’t expect that to work. It must have to do with either the way includes are handled on your server or the way the site’s set-up. I suspect the latter in which case I’ll have to revert to my alternative suggestion. Did you check your server’s error log to see if an error is being generated?
Bell responds:
Posted: May 23rd, 2008 at 7:43 pm →
Hi Mike thanks again,
my server log says [public_html/gbcf-v3/gbcf-v3/files/focus.js] does not exist. I noticed the repeat of the gbcf-c3 folder. Its the same for [public_html/gbcf-v3/gbcf-v3/files/themes/default.css]
Would this cause my thankyou page error?
Mike Cherim responds:
Posted: May 23rd, 2008 at 8:48 pm →
It seems those files aren’t being found from… there should be a referrer in the error. This wouldn’t have anything to do with the redirect not working so back to square one on that. I don’t think I can help. No associated errors makes it very difficult.
David O'Neill responds:
Posted: May 24th, 2008 at 7:02 pm →
Mike I would just like to say thank you for all the hard work you put into this script. It is amazing and I thank you for releasing it to the general public.
I love how easy it is to configure…..LOL the only problem I am having now is actually adding the form to my own xhtml page hahahaha but I will work it out.
Thanks a million again,
David O’Neill
David O'Neill responds:
Posted: May 24th, 2008 at 7:23 pm →
Hi there sorry about this question…..I am just a noob web designer. I am trying to integrate this fantastic form with my own web page which is written in xhtml and css. I was hoping to place the form in a div of its own.
Is there any chance that somebody could post the code required so I can have it within one of my own pages. I have been hunting this site and the files for the info and I just cannot find it.
Thanks
David
Mike Cherim responds:
Posted: May 24th, 2008 at 7:30 pm →
It already has it’s own div. Just place or position that on yor page. View the source of the text form to get the div’s ID. It’s probably in the CSS that comes with the form. I think.
Pascal responds:
Posted: June 11th, 2008 at 5:29 am →
Hi Mike,
When we want to rename the main folder of your script, you require us to modify the $set_directory variable three times in the functions.php file… What about using the keyword “global” to avoid having to set the variable again inside your functions?
Instead of
”
function list_langs() {
$set_directory = “gbcf-v3″;
“,
you would have
”
function list_langs() {
global $set_directory;
“
Mike Cherim responds:
Posted: June 11th, 2008 at 8:22 am →
I will be doing something like that. I actually have two fixes but haven’t implemented either due to time.
Mike Young responds:
Posted: June 20th, 2008 at 8:46 am →
Hi Mike and Hi All.
Mike first up. Great form script and a easy install both locally and server wise. I have a quick question for anyone that might be able to help. On the form itself the first 2 labels are Obligatory.
I need the Obligatory fieldset to include the telephone number and for it to be a and required input field. Hope I am still making sense. I’m not a whizz like some with php and form validation.
So I have moved the telephone field/label in to the Obligatory fieldset. The question is how do I now make sure that the field is validated? A live copy can been seen here - www.caminoproperties.co.uk/contact.php
Any help would be really appreciated.
Thanks
Mike
Mike Cherim responds:
Posted: June 20th, 2008 at 9:26 am →
You’ll have to go through the functions.php and form.php files to complete the changes. I guess you did the form part so now it’s a matter of going through the function file to address the various changes. Each part of the script is commented so it’s just a matter of making the edits.
Mike Young responds:
Posted: June 20th, 2008 at 9:50 am →
Hey Mike. Thanks for the response.
I have the functions.php file open.. Is it just a case of striping this line out?
if(isset($_POST['phone'])) {
$phone_value = clean_var($_POST['phone']);
}
Then moving it up to follow on from the code underneath?
// Required
$id_value = clean_var($_POST[''.$form_id.'']);
$name_value = clean_var($_POST['name']);
$email_value = clean_var($_POST['email']);
$phone_value = clean_var($_POST['phone']);
Thoughts? Perhaps I am barking up the wrong tree here. If so I’ll guess I’ll start again.
Mike
Mike Cherim responds:
Posted: June 20th, 2008 at 10:21 am →
Wrong tree I’m afraid. You actually don’t need to do that (it’s actually meaningless), but there many other steps. Many you’ll find in the last third of that file.
Mike Young responds:
Posted: June 20th, 2008 at 11:01 am →
Thought so!! I did say that I was not a whizz at this..
I skimmed through the functions.php file again.
I did notice the Error Management. Is this the area I should be looking - Line Nº 799 onwards..
Forms works great apart from my inability to validate the required fields..
Mike Cherim responds:
Posted: June 20th, 2008 at 11:25 am →
Yes.
Mike Young responds:
Posted: June 20th, 2008 at 12:27 pm →
Thanks Mike.
Seem to have the functions.php file sorted. Thanks for that. Quick question?
When adding field/labels in the form to the Obligatory section, which bit of code am I moving?
Sorry to be a pain.. You have already been more than helpful..
Thanks
Mike
Mike Cherim responds:
Posted: June 20th, 2008 at 1:13 pm →
You’d move every part of that particular input, including its label. Make sense?
Ben Martin responds:
Posted: June 22nd, 2008 at 11:05 am →
Great script!
Very well done, well coded, well documented, quick & easy to install (and, furthermore, it works!), full of useful options and secure as well - thumbs up to the developer (Mike)!
I’m happy to have found this script, and will definitively remember it…
-Ben
Sandra responds:
Posted: June 22nd, 2008 at 2:21 pm →
Hi Mike,
Fabulous script, many thanks. You mentioned in the changelog the current version as removing the lang attribute in form.php so the main form validates in xhtml 1.1. I’m still getting a validation error, though, and can still see the lang attribute there. Is there a simple way I can edit this out?
Mike Cherim responds:
Posted: June 22nd, 2008 at 5:34 pm →
There is a
lang
attribute in the footer of the form, Sandra. To edit, open the form.php with a text editor like Notepad, then scroll down that page quite a bit and you should find it. I will be releasing another build soon(er rather than later) and that will be done.Mike responds:
Posted: June 25th, 2008 at 4:37 am →
Hey Mike
Thanks for your help last week. I really appreciate it and a donation will be coming your way to say thanks.
One quick question for you or anyone else out there may be able to help with. when viewing the form within IE7 the field backgrounds are yellow whilst in firefox they are all white as set by me via the css file.
Does anyone know of any css hack, trick or tip to get those backgrounds to appear white aswell?
Thanks
Mike
Mike Cherim responds:
Posted: June 25th, 2008 at 7:52 am →
Turn off your browser’s/browser’s tool bar Autofill feature. Only those with Autofill will see colored inputs (on inputs Autofill recognizes). I’m not sure how/if the color can be changed [in your browser].
Mike responds:
Posted: June 25th, 2008 at 8:02 am →
Thanks Mike
Marie responds:
Posted: June 27th, 2008 at 11:59 am →
NO MORE SPAM SINCE INSTALLING YOUR BRILLIANT FORM!
I KNOW I’M SHOUTING BUT I CAN’T HELP IT!
You are my hero, Mike. (That was a hushed whisper.)
Mike Cherim responds:
Posted: June 27th, 2008 at 1:12 pm →
Thanks for the shout Marie
Neil McDermott responds:
Posted: July 7th, 2008 at 12:36 pm →
Hi Mike,
Great form script!
I have integrated it fully and it works fantastically expect I can’t get the CC to work.
The form sends fine which suggets that it’s not an issue with the sendmail setup, however when I tick the “Check for email copy” box, nothing gets sent on to the email address set in the form.
This also happens on the test-form.php - unless it takes longer for the CC emails to be sent than the actual email?
Thanks,
Neil
Mike Cherim responds:
Posted: July 7th, 2008 at 1:15 pm →
The CC feature simply allows a second
mail()
function to activate so it’s really the same as the primary one. Maybe your host doesn’t allow two emails to be sent per post? I’d ask them. Next thing I’d do is check that second address.Neil McDermott responds:
Posted: July 8th, 2008 at 12:20 pm →
Thanks Mike,
I’ll take a look.
MadBabble responds:
Posted: July 21st, 2008 at 9:51 am →
Thanks for this i need something like that
Marti Mundo responds:
Posted: July 26th, 2008 at 3:29 pm →
Hi Mike,
I translated the language file in Catalan (es-ct), but I don’t know how to send you because I don’t found your email.
Mike Cherim responds:
Posted: July 26th, 2008 at 4:26 pm →
The best thing to do is to use my form to contact me telling me basically what you have above, I’ll reply and you can send it in your reply. Sound like a plan?
Rick Bible responds:
Posted: August 2nd, 2008 at 3:41 am →
I’ve used your forms for a while and love em. I actually have this one working within highslide js as a “popup”. It opens not in a new window but on the same page. Form works, sends mail to both parties. Is there a way to not have the page refresh when sent? I’m just tackling this problem. The popup naturally closes when the page refreshes so “thankyou” or “error” cannot be seen. Maybe this is just contrary to the inner workings of the form and it’s not possible. Thanks, Rick
Mike Cherim responds:
Posted: August 2nd, 2008 at 5:56 am →
Not sure how to address the issue. It is an open item,
Tony Hayter responds:
Posted: August 4th, 2008 at 9:38 am →
Mike
I am trying to add a joining form to our website. Your version 3 looks just what I need. However I don’t fully understand what information is needed in the variables in your Readme.txt file, $send_email, $reply_email, $addressee, $web_site.
These are clear to me in version 2.
Would you help please?
Tony
Mike Cherim responds:
Posted: August 4th, 2008 at 10:14 am →
There is a help page with the v3 form. On that page all of the variables are explained in exquisite detail. Have you read that? If not, please do then let me know if you have specific questions you still need answers to.
MykeeCDN responds:
Posted: August 4th, 2008 at 9:00 pm →
Mike, this is a FANTASTIC script - thanks for making it available to us all!
One improvement request: it would be great to be able to flag certain fields as required and others as not. For my needs, I want Name and Phone required, all other fields optional or even not displayed.
Thanks again, keep up the great work!
/\/\
Tom responds:
Posted: August 4th, 2008 at 9:16 pm →
I think this is the best form I have tried, by far. Not working with PHP on regular basis I am amzaed how easy it is to create pages/forms that are hacked right away. I would like to see image-based validation of human entry rather than the static question “Fire hot or cold”. The PHP installation on my ISP has this as an available function. Any plans for this? Thanx.
Tom
Mike Cherim responds:
Posted: August 4th, 2008 at 10:03 pm →
@MykeeCDN: Thanks. I would like to be able to offer something like you suggest, but I just can’t seem to wrap my brain around how I’d get that to work. I think I’d have to start from the ground up with a script designed with that in mind.
@Tom: Thanks. As far as image based validation, a.k.a. CAPTCHA, is not something I’ll be adding for two reasons: First of all it is not an inherently accessible method and needs to be made so by adding text (what we have now) or audio, and; second it doesn’t seem necessary. Mind you with this form there are like 17 security measures so I’m not relying on that particular method as the sole means of form security.
Mer responds:
Posted: August 4th, 2008 at 11:11 pm →
Hi Mike, I have a question that I’d like to ask but first thank you for sharing the script
So I’m using the default theme for the contact form and I just want to change the size of the text form fields - name, email, message, etc. I edited the value of rows and cols in the form.php to make it smaller but yet all of them remained the same as the default original size. I’ve been fiddling around to see if I need to make any changes at some other files but I can’t find any. Can I get your help on this please? Thank you.
Mike Cherim responds:
Posted: August 5th, 2008 at 12:20 am →
You shouldn’t edit the form.php file. Use the CSS file and change with width and height of the textarea assuming you have linked to the file from your web page. Name, email, and all those bits of text are the labels. To change the text size itself look for
font-size
The only files you should want/need to edit are the CONFIG/php and language file. The style sheet as well, though some people will just add the form styles to the site’s existing style sheet.Rick Bible responds:
Posted: August 5th, 2008 at 10:35 pm →
got the popup issue resoved, works great. Thanks for a great email form.
Daniel responds:
Posted: August 31st, 2008 at 1:07 pm →
Hi, Mike. Great form script. I’m noticing one major issue with IE focus — in that it hijacks any other form elements’ focus, such as a search input field. I have a trivial value set with the focus/blur technique to show/hide the value if a user clicks within the box — in IE this will not work with the IE focus.js installed.
Any suggestions on how to regain focus on form elements that aren’t a part of this email form? Or, is it a bug within your focus.js that can be corrected?
Mike Cherim responds:
Posted: August 31st, 2008 at 2:21 pm →
You could just call for the focus script on your contact page only, perhaps? I’m not much of a JavaScript guy so I’m not sure what else. I think the focus script can be more specific, named/id’d or whatever and that might help. Check the arrangement too, call for your script last though I’m not sure if that’ll work.
Daniel responds:
Posted: August 31st, 2008 at 4:32 pm →
I’d suggest then that you might wish to include an ID wrapper for the following DIV in the IE script:
gb_form_div
That way, you’re including the proper IE focus method that only calls on your form and doesn’t bump the others on the page. I mean, since it’s only being applied for IE, and we’re only requiring it for the form — what’s the point in having the function apply to all form elements on the page anyway?
Mike Cherim responds:
Posted: August 31st, 2008 at 6:04 pm →
I apply form focus to all inputs on all my sites, as do many people I know, so the fact that it works the way it does is actually beneficial. If you want steal the JavaScript from GrayBit.com. That’ll work the way you want. You can also just remove the JS file and don’t offer focus for IE, or you’re welcome to employ the suggestion you made above.
Daniel responds:
Posted: September 1st, 2008 at 1:17 am →
So, in other words — there’s no way that you know of that will allow a theme developer to retain the onfocus/onblur value within a text-field while using your IE script.
I might as well just strip the value out of the field then, because it’s become less functional this way — though, I’ll be stripping accessibility out of the text-field even more by eliminating its value attribute.
In this development case, I don’t want to alter the plugin — I want to alter the theme. I feel that most plugins shouldn’t be altered because it inevitably creates an updating conflict where something gets borked as a result.
Thanks though, Mike.
Mike Cherim responds:
Posted: September 1st, 2008 at 1:08 pm →
Adding a value to an input is no longer an accessibility concern. Most developers no longer do it to comply with WACG 1, and it’s no longer a recommendation for WCAG 2 at all. The reason for it was based on old technology. It no longer aids accessibility. If that’s why you did that then you don’t have to be as concerned about it.
The other suggestion is also perfectly valid if it’ll work for you: Make the script available on the contact page only. That’s pretty easy to do with PHP while using a single header file. Something like this would work.
Chris responds:
Posted: September 2nd, 2008 at 1:54 pm →
Hi, Mike!
Thanks for sharing this contact form with us. We are having a problem similar to Mark’s back in March. Our host has begun disallowing the method Open_basedir. They told us that we will need to rewrite the paths and path calls in the php contact form in order to resolve this issue. Currently, if I submit my contact form without filling in the required fields, I get this PHP Warning:
file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../../..//files/error-log.txt) is not within the allowed path(s): (/home/cbpeary:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/cbpeary/public_html/gbcf-v3/files/functions.php on line 470
Do you know a workaround for this? Thank you!
Mike Cherim responds:
Posted: September 2nd, 2008 at 3:22 pm →
I’m not sure Chris. I suppose you could change the path in the files (
$set_directory
) to a full path. That might work. I did notice that the one error you posted shows an incorrect path (//files/
). That’s broken, but I’m not sure if that’s what you printed out or if it was posted wrong. I don’t know if that has anything to do with the issue. Then again, I can’t say I really understand the problem myself.Chris responds:
Posted: September 2nd, 2008 at 9:44 pm →
Thanks, Mike. That didn’t work, but I tried deleting the last four lines off the trip_error method (lines 468-472) and that did the trick! I’m not quite sure why that fixed the problem, but for some reason my server had a problem with it.
Thanks again for a great script!
Sincerely, Chris
Mike Cherim responds:
Posted: September 2nd, 2008 at 10:14 pm →
Those lines, Chris, would that be the error log writing? I’m not sure what build you’re using but those line numbers don’t quite line up right with the local build. Maybe I should make stats collection optional, then the switch could be used to bypass the operation. Hmm.
Zach responds:
Posted: September 3rd, 2008 at 4:20 pm →
Howdy Mike, hail from Keene, NH. I’m having an issue trying to reference my form from another subfolder…specifically whenever the field validation/reset occurs…it opens into the gbcf-v3 folder form.php page instead of sticking to the include(). Doi. I know this is probably an easy fix, but if you wouldn’t mind setting me straight, I’d really appreciate it.
Great work, btw!
Zach responds:
Posted: September 3rd, 2008 at 4:38 pm →
P.S. - is there a way to create other fields, mainly radio buttons, in this form (for multiple selections)? I mean, I’m sure I could do it separately from the form itself…but if there is a more direct way, that would be splendid.
Thanks Mr. Mike!
Mike Cherim responds:
Posted: September 3rd, 2008 at 4:54 pm →
Hi Zach from Keene
I’m not quite sure what you are asking, but if including the form.php into any page, just set the path in the include function so it’ll locate where your files are, though I’m not sure if that’s what you’re asking. As far as adding other fields, some can be re-utlized, but there is no provision to add. And I’m afraid it would be a lot more complex than just adding the HTML to the form file.
Zach responds:
Posted: September 3rd, 2008 at 5:13 pm →
Hey Mike,
Thanks for the incredibly fast reply…(quite the moderator)…but the include works fine, the form comes up marvelously, css and all. However, whenever the Submit is made, whether error checking or resetting, my page with nav and all disappears, the form is by itself and no more css. Perhaps I installed wrong…perhaps I should move it into my contact/ folder where the contact page is located? The URL goes from “..mydomain.com/contact/index.php” > Submit > to “.mydomain.com/gbcf-v3/form.php#results”. Forgive my coding ignorance…
Mike Cherim responds:
Posted: September 3rd, 2008 at 5:30 pm →
I really don’t know. I think I’d have to check out how you set it up. It’s not a problem I’ve heard of before and I’m not quite sure why it’d do that. Curious, what is the form action?
Zach responds:
Posted: September 4th, 2008 at 10:05 am →
‘Morning…the form action itself is set to blank…(I noticed another commenter had a similar problem) but when I direct the form action to the contact/ folder, and the form is Submitted, it comes back blank, no mail sent. Zippo. I’ll look deeper into it today…I mean, it works fine when you just Submit without a form action…but like I said, it opens into just the form page without the style sheet, and no way to return to my page where its include()’d. Bewildering…but I’ll keep at it.
Mike Cherim responds:
Posted: September 4th, 2008 at 10:27 am →
I meant the actual form action in use now. View source to see what it is.
Zach responds:
Posted: September 4th, 2008 at 10:40 am →
/gbcf-v3/form.php#results
Mike Cherim responds:
Posted: September 4th, 2008 at 11:54 am →
That’s the problem, and I can only assume you’re not really including the form.php file into your contact page. If, for example, you check out my contact page (uses the same version form), you’ll see my form action is
/contact/#results
. Also, see the form action on the test form page:/gbcf-v3/test-form.php#results
.You’re not supposed to access the form.php file directly, but it needs to be included in your page. Once you do that the form action should reflect the proper action (pointing to itself, not the form page). The action also serves as a reset link so you were resetting to the form page too.
Zach responds:
Posted: September 4th, 2008 at 2:57 pm →
Hmmm…I’ve inserted the inlcude from the contact/index.php page as so:
(content)
(content)
I suppose this is what you’re referring to as being ‘directly’ accessed. I just get my logic mixed up from time to time. I thought maybe there was a way to bypass this by changing the $set_directory but I guess its more straight-forward than that. I wanted to keep my existing page and folder structure as-is but it looks like I’m going to have to rethink…? Perhaps if I send you a few snippets of my code, you might better understand my situation?
Zach responds:
Posted: September 4th, 2008 at 3:02 pm →
Whoops…sorry…
(content)
<?php include('http://www.diversifiedcomputers.net/gbcf-v3/form.php'); ?>
(content)
Mike Cherim responds:
Posted: September 4th, 2008 at 3:22 pm →
Now that I have your URL I see that things are pretty screwed up. First of all you’re not even using v3. You’re using v2, the April 14, 2007 build to be precise. That means that not only have you posted for support in the wrong place (thus confusing things), just abouth everything we’ve been talking about thus far is completely irrelevant.
Looking at the source, your form action is
/emailform/gbcf_form.php#results
. Regardless of the version, it should be/storeinfo/contact.php#results
. That’s why it’s not working — you’re not submitting to self as it should be.Zach responds:
Posted: September 4th, 2008 at 3:41 pm →
Hahaha, my bad…however, the actual form (v3) is not the contact page, but the training page. Still, the same problem exists which I will apply to the other form.
Mike Cherim responds:
Posted: September 4th, 2008 at 4:04 pm →
Let me know what you find. This is fairly strange.
Dave responds:
Posted: September 4th, 2008 at 4:16 pm →
Mike…your form seems great. However, I can’t get the emails to go through. I got the SMTP settings we use to send our e*statements. The email is never received. The host did state that sendmail is not enabled on the server. Could this be the problem? If so, is there any way around it?
Zach responds:
Posted: September 4th, 2008 at 4:19 pm →
I KNOW! Ain’t it??! Anyway, I’m pretty sure its just my file/folder structure…I’ll get it!
-Thanks
Zach responds:
Posted: September 4th, 2008 at 4:48 pm →
HAHA! Just needed to set the new directory, and reattach the form to the training/index.php page, and bing, bada, boom..we’re now in business…its directing the action to the correct page! Whew…just needed to get up and walk away from it I’ll get to the contact page later, hahaha!
Thanks again for the assist, Mike, sorry to bother!
Mike Cherim responds:
Posted: September 4th, 2008 at 5:02 pm →
@Dave: If the form is sending, then it should go. I normally recommend asking the host to troubleshoot as they over anyone else would be able to quickly assess the matter. The form doesn’t use snedmail, strictly the plain-Jane PHP
mail()
function.@Zach: Awesome. Just love a happy ending
Michael responds:
Posted: September 13th, 2008 at 4:56 am →
Hi,
Love your contact form. I plan on using it as often as possible!
I am having a little trouble with the stylings.
Primarily I have this site for a friend going.
http://www.istillloveyou.com.au/clients/standtall/
I’m happy enough with it in firefox but in IE it is a mess. The contact form sits itself in the middle of the page instead of to the left.
If this is a specific IE bug that you know of I would just be happy with the name of it so I could research how to fix it (and not repeat it) myself.
Kind Regards,
Michael.
Mike Cherim responds:
Posted: September 13th, 2008 at 9:09 am →
I use FF too (looks good), but it looks like you have it aligned right, maybe just set a fix width for the form or its main div. If that doesn’t work I’d go to someplace like SitePoint.com, and request CSS help. IE is one big bug, but I don’t the root cause of your issue, it could be anything.
One additional note: The question you’re asking is overkilled difficult (unnecessary to make it hard). 16×8= not only proves they’re human, but that they also have a calculator on them.
Michael responds:
Posted: September 25th, 2008 at 2:38 pm →
Hi Mike,
Is it possible to use radio buttons for the Subjects instead of a drop down?
Kind Regards,
Michael.
Mike Cherim responds:
Posted: September 25th, 2008 at 3:42 pm →
They could, Michael, but the the script that produces the pulldown menu would have to be modified to produce radio buttons. As far as I know this would only need to be edited in the form file (form.php).
Phil responds:
Posted: October 7th, 2008 at 12:36 pm →
Hi Mike,
Just discovered this remarkable script.
I’m new to this game, so I’m probably asking what everyone knows, but here goes.
You say 666 permissions are required. I’m using a shared server, and 755 is the highest they will allow. But another PHP script I’m using apparently runs without permissions because suexec is installed.
Does that apply here? PHP 4 is running as cgi. PHP 5 is available.
Thanks
Mike Cherim responds:
Posted: October 7th, 2008 at 1:22 pm →
You might want to install the script and bring up the validation page. If you get the green bar then the file has the right permissions. If not then you will need to ask your host to allow that file public write access. It’s safe so they shouldn’t have an issue.
Phil responds:
Posted: October 8th, 2008 at 9:43 am →
Boo hoo!
Doesn’t work! Even with suexec and the permissions set to 755 I get the error:
“Not Found
The requested URL /gbcf-v3/validation.php was not found on this server.”
755 is the highest permissions my isp will allow on the shared server under any circumstances, no matter how secure the script you’re installling.
There’s no other possible explanation is there (apart from the file not being there - which it is!)
Thanks
Mike Cherim responds:
Posted: October 8th, 2008 at 10:16 am →
If you’re getting a not found error then your path to file is wrong or the folder has the wrong permissons. Regarding permissions, 755 is a folder permissions and all your folder should be 755 (to find the files that is), The only permissions that need to be touched are for that single text file. You shouldn’t or need to change permission on any other file or folder.
Again, a quick email to your host will have this resolved quickly. If you haven’t done that, then that’s what you should do. Otherwise contact me via my form and give me your URL.
Phil responds:
Posted: October 8th, 2008 at 11:37 am →
Thanks for clarifying.
The path was definitely correct, so it brings us back to the permissions.
My host’s faq says: “To avoid any problems, you should set your PHP scripts file permissions to 644, or user read and write, group and world read.”
I’ve tried that as well as 755, and neither work. I have, as you suggest, written to my hosts in the hope that they have a separate policy for non-executables, but since the previous script I hoped to modify only required change to a config directory’s permissions, I’m not hopeful.
I’ll let you know when I hear back from them.
Best wishes
Phil responds:
Posted: October 8th, 2008 at 12:00 pm →
Hi again,
This is my host’s response:
“Many thanks for your query. You should have no problem changing the permissions to 666, however please be aware that there are certain security implications with this. Having permissions set to 666 would allow write access via the web. We do not recommend this but it is possible to set those permissions.”
So you are right. It is possible to set 666 permissions. But they say ‘there are certain security implications’, while you say ‘It’s safe’. Which is true?
Best wishes
Mike Cherim responds:
Posted: October 8th, 2008 at 12:56 pm →
666 applied to the error log text file will be safe. The biggest permission issue to avoid on the web is to not set folders to 777. Default for files is typically 644, for folder is 755.
Phil responds:
Posted: October 8th, 2008 at 1:13 pm →
Hi Mike,
I’ve questioned them about their concern about security issues. They are concerned that the log file might contain confidential server information which an outsider could use as privileged information. Sorry to be so thorough about this, but I don’t want to be prosecuted for installling a script which, however unwittingly, gives out privileged information. Looking at your background and commitment I’m sure your positive intentions and professionalism are of the highest level, but because I’m not experienced enough to understand the way in which the script works and whether there are any risks involved or not, I have to understand more in order to make a decision when two sources tell me opposite things!
What exactly does the logfile log, and why does it have to be included in the script?
Thanks for your patience!
Phil responds:
Posted: October 8th, 2008 at 1:16 pm →
PS,
and why does it need 666 permissions, why aren’t local user write permissions adequate?
Mike Cherim responds:
Posted: October 8th, 2008 at 2:37 pm →
The permissions are required so that PHP can write data to the file. If PHP* created the file this wouldn’t be necessary as PHP would be the owner. As it is, though, PHP is the user, the server is the owner. As far as what’s written, it’s only a number. If a spam bot triggers an error the file contents changes from the number 0 to the number 1, then another bot comes along and triggers an error, the number changes from 1 to 2, and so on and forth. It will keep going up to the count limited typical with PHP.
Your host will be happy to know that the file has this limit (8 bytes). In other words if someone were to try and writer more data to the file the script would become non-functional. This is for added security. When it comes to security I tend to go way overkill, erring on the side of caution, in preparation for threats that haven’t be discovered yet.
*I could have had PHP create the file making this step unnecessary, but support for this is iffy web-wide so I decided to have users change it if needed.
Phil responds:
Posted: October 8th, 2008 at 2:39 pm →
Thanks Mike,
Very clearly and reassuringly put!
I’ll retry the installation.
Best wishes
Phil responds:
Posted: October 8th, 2008 at 2:47 pm →
Hi again!
On another much less significant, but still important issue:
I see that the test form has a box near the foot labelled:
“Check for email copy”.
I realise there are variations of the page depending on language, but this mid-atlantic one is the one I would be most likely to use. Is there any way I can change that label for the box? To someone from the UK it says ‘Click here if you want the system to check this has been sent by email’ or something similar, and not ‘click here to send a copy to your mailbox’ which I think is what is meant.
Is it easily editable, if so where?
Thanks
Mike Cherim responds:
Posted: October 8th, 2008 at 3:18 pm →
Easy one, Phil. Use your preferred language file and edit with a text editor to read however you like. Optionally, in the config, you may disable that feature altogether.
Phil responds:
Posted: October 8th, 2008 at 11:32 pm →
Hi again,
I couldn’t sleep - kept waking up thinking about making the installation of the script the most secure I can!
Two things stuck me, the first is that if it could be installed above webroot, it would put the logfile out of reach of anyone on the web, and second, if the main directory was renamed, this would prevent anyone from finding it by searching.
I see I can do the second (though I’ll try it on the server ‘as-is’ first to check for compatibility. But what about installing it above webroot. My research tells me that this can create problems for paths, but that depends how you’ve set up the script.
Feedback appreciated.
Thanks
Mike Cherim responds:
Posted: October 9th, 2008 at 12:01 am →
It could be done that way, but for a distributable script, it creates more problems than it’s worth. And, yes, as you pointed out, you can change the directory name.
Andrew responds:
Posted: October 9th, 2008 at 1:12 am →
Love this script,
Recently I have encountered no copy being sent to individuals that are filling out the form but mail is received to the destination email for the website, I have used this same script with other site as I like the consistency it gives me but this problem is baffling me site in question is http://jpfpi.com/contact.php, any help with this would be much appreciated as I am new to the world of web design but find it easy with programmers providing scripts like yours.
jody responds:
Posted: October 9th, 2008 at 1:27 am →
I love this script! Thank you so much for sharing this! I have one quick question. Is there a way to delete just the required subject drop down and leep the text area for the subject? I have played with it a bit and got rid of it on the form itself but when you submit the form the error comes up that it has not been filled out. I am assuming that there is more to this than just getting rid of it on the form.php. Any suggestions?
Thanks again for a great form.
Mike Cherim responds:
Posted: October 9th, 2008 at 8:20 am →
@Andrew: I would suspect the mail is being blocked by the third party’s spam filter or mail provider. They need to contact them and investigate. If the form sends and that is checked, then the mail is being sent.
@jody: You’d have to give that variable a fixed value (such as added “selected” to another menu item). Please bear in mind that one of the security features is built around that. Moreover, without it you may need to address the subject line string of the mail.
Phil responds:
Posted: October 9th, 2008 at 10:55 am →
Hi Mike,
So are you saying it’s not possible to for the user to easily configure the script in order to be able to store it out of the way of web access? Would too much configuration be involved?
Best wishes
Mike Cherim responds:
Posted: October 9th, 2008 at 11:50 am →
It’s doable Phil. I just don’t do it with the script as it’s a lot easier to allow the whole thing to be uploaded in one place. If you’re more comfortable putting the log file on the root then you’re certainly welcome to do so. Again, though, it’s not a security issue as is so there’s no need to do it.
Phil responds:
Posted: October 9th, 2008 at 12:37 pm →
Sorry, I seem to have miscommunicated. What I meant was, putting the whole directory out of the reach of the web, and then calling it (just as you would a database) from the form itself. Would I need to have to make any changes to do this, or is that non-doable? Your comments about the logfile and my isps’s feedback have convinced me it’s not necessary, but is it workable with the script in its present form?
Thanks
Mike Cherim responds:
Posted: October 9th, 2008 at 1:26 pm →
You’d have to go through the script and update all the paths. Seems pretty unnecessary to me as it won’t make anything more secure. I mean the files are already secured being that none of the files can be accessed directly (even if you have the full URL to any file). Try, for example, accessing the form.php file directly. You can’t. Furthermore, if you do do that, updating the script as newer build become available will a lot more difficult.
Phil Maybury responds:
Posted: October 9th, 2008 at 6:28 pm →
Thank Mike,
I take your point. I would be more work than it’s worth. I just like to understand in order to take decisions.
I’m tied up tomorrow, but I’ll try installing the script early next week and let you know how I get on.
Best wishes
Phil responds:
Posted: October 13th, 2008 at 12:34 pm →
Hi Mike,
Successfully up and running thanks. I’ve only had one matter of feedback from my clients yet, and that’s about the challenge question. “My only comment would be that where the question is for people to answer and it says that it is to prove you are a person perhaps you could add after ‘a person’ ‘and not spam’ otherwise some dumbo might wonder why you need to know if they are a person!”
I would prefer to say something like “…a real person and not a rogue computer system” but I’m not sure if adding something like this creates any more security risk by drawing the attention of robots.
I’m sure you can tell me - could you?
Best wishes
Phil responds:
Posted: October 13th, 2008 at 1:23 pm →
Hi Mike,
You’ve already answered my question by a visit to your own contact form where you use:
- “Helps fight spam”.
That will do nicely.
Best wishes
Ergin responds:
Posted: October 13th, 2008 at 3:08 pm →
Hi Mike, may I say thank you first for this wonderful script.
It’s been hours I was trying to inbed (???is it the correct word) into the HEAD
DIRECTLY AFTER
AND
Into BODY of my HTML contact page UNsuccesfuly. It is just driving me insane.
My test contact page is working perfect.
Any suggestion is more than appriciated.
Mike Cherim responds:
Posted: October 13th, 2008 at 8:15 pm →
@Phil: Awesome you got it done. Re the text: That’s the beauty of an easy-to-edit language file. You can edit it as you like
@Ergin: To post HTML in this blog you need to convert your left and right angle brackets at least. I’m not sure what you were posting, but I have a feeling it can be answered with “check your path to the file.” Please elaborate and let me know.
Ergin responds:
Posted: October 14th, 2008 at 3:21 am →
ahhh I am sorry Mike. Basically I am referring to Script installation Point 9. I have followed the instructions but without success. I would be so grateful if you could you look at my “Contact Us” page source code. I have tried so many ways of the path. I am thinking that maybe my page is already connected to a CSS style sheet. Could this be the problem? Would really appreciate your advice.
Mike Cherim responds:
Posted: October 14th, 2008 at 9:08 am →
There’s nothing to see, it doesn’t seem that you added it. Add the link to the style sheet and to the JS file in the head of your document (as per the examples given right below step 9). Put it just under the CSS link you have, and correct the path so it finds the file.
Ergin responds:
Posted: October 14th, 2008 at 12:37 pm →
Dear Mike, my sincere apologies, being an almost novice is rather embarrassing sometimes.
I have followed your advice again but unfortunately I still am not able to see the form.
would you terribly mind if you check my source code again?
it is obviously in my website.com/contactusnew.html
1) When I uploaded the gbcf-v3, my Fireftp was in Binary mode
2) gbcf-v3 is in main directory where all my html pages are.
3) Only change I made is renaming blue.css to default.css (as I said my test page (in blue) works perfect)
Thank you again.
Mike Cherim responds:
Posted: October 14th, 2008 at 12:55 pm →
You should check out the FAQs as this is covered. I can see the PHP code in your HTML page. That means the page needs to be a *.php page or you need to contact your host to have them enable PHP on HTML pages. I shouldn’t be able to see the PHP code by viewing source so since I can that explains the issue: No PHP support on that page as is.
Ergin responds:
Posted: October 14th, 2008 at 1:46 pm →
OK MIke, apparently PHP is fully supporet by my Domain Server (ICDsoft). Yo my surprise support ticket was answered almost immediately.
So I decided to rename the web page to contactusnew.php, published it and this is what I see in my page…
Warning: include_once(www.ayvalikholidayhouse.com/gbcf-v3/form.php) [function.include-once]: failed to open stream: No such file or directory in /home/ayvalik/www/www/contactusnew.php on line 149
Warning: include_once() [function.include]: Failed opening ‘www.ayvalikholidayhouse.com/gbcf-v3/form.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/ayvalik/www/www/contactusnew.php on line 149
Mike Cherim responds:
Posted: October 14th, 2008 at 3:28 pm →
Well you’re getting closer. I’m not surprised it failed to open as your path is wrong. First of all if you put a full URL you must give the protocol:
http://
in this case. However, try dropping all that and just put the relative path inside the include function:/gbcf-v3/form.php
Ergin responds:
Posted: October 14th, 2008 at 5:26 pm →
Well Mike, you’ll be glad to know that I have done it. When I design the rest of the form (hopefully I will not disturb you again) I think I owe you BIG time. My appreciation will also be reflected by clicking on the “Donate” button.
One question comes to my mind…..I thought by putting the “include Function” one would not have to change HTML to PHP of my web page. I now have to change all the relative links to.
I suppose I must have misunderstood, mustn’t I?
Mike Cherim responds:
Posted: October 14th, 2008 at 5:46 pm →
In order for a PHP script function, such as
include_once()
, to work, PHP must be recognized. Assuming PHP is installed on the server, this can be facilitated by giving the page a *.php extension, or by configuring the server to process PHP on non-PHP pages. As you have changed your file extension you will need to update your nav (that reminder is actually on the help page). To make life a bit easier, provided your host is willing, you could elect option B: configuring the server.Glad you got it working.
Tim Taylor responds:
Posted: October 15th, 2008 at 5:14 am →
Hi Mike
A great script and a great service to web users and publishers alike - many thanks!
Has anyone noted that the text at the very bottom of the form (includes ‘blocked’ and the link to your site) when viewed in IE7 is misaligned? It is bisected by the bottom boundary of the form.
Here’s an example at I’ve tried it using the default.css as well and it makes no difference. I don’t use IE7 but unfortunately many people still do!
Cheers, Tim
Mike Cherim responds:
Posted: October 15th, 2008 at 6:39 am →
Yeah, I knew that Tim. With the fieldset border off it’s not noticeable so I didn’t really worry about it too much. As far as I know that’s slightly different in all browsers, mostly due to difference in the submit input. You didn’t complete your example link — it was an empty anchor.
Tim Taylor responds:
Posted: October 15th, 2008 at 7:05 am →
Thanks for that Mike, I’ll turn the fieldset border off.
Tim
Ergin responds:
Posted: October 16th, 2008 at 6:05 pm →
Hello Mike,
Today I set up my Turkish Contact Form by renaming your form to gbcf-v3tr. Everything working apart from the Turkish charecters displaying wrong when it is online.
Setup as below:
$language = “tr”; // Name of language file
$char_set = “ISO-8859-9″; // Character set for email
You can see it here……mysite/iletisim.html
I wonder, what might I be doing wrong this time please?
Mike Cherim responds:
Posted: October 16th, 2008 at 6:34 pm →
That character set is only for the email. Try saving the Turkish language file as UTF-8, though I’m not sure what’s best for your language. If worst comes to worst, convert remaining problem characters with proper character entities… that will ensure that it renders properly.
Ergin responds:
Posted: October 16th, 2008 at 7:50 pm →
Thank you for your answer Mike.
UTF8 did not work. But I have changed all the problem characters with proper character entities… So the problem solved…Thanks a bunch again.
Phil responds:
Posted: October 20th, 2008 at 2:44 pm →
Hi Mike,
I’ve been struggling with a second installation of the script on another virtual server for several hours now. As far as I can see, I’ve correctly modified the CONFIG.php file (I’ve checked that the quotes and semicolon are intact on each line) given 666 permissions to the logfile, and modified the language file.
Yet when I run validation.php or test-form.php I get the error:
“Configuration Error:
“The default reply-to email, , needs to be set or changed.”
I’ve simply copied over the configuration files from the other installation, and changed the domain-specific information, so the files should be spot on.
Is there anything else that can result in this error? It’s probably something simple I’ve missed!
Thanks for your help.
Mike Cherim responds:
Posted: October 20th, 2008 at 4:04 pm →
It seems you didn’t change the reply-to address in the config. That’s the only thing I know of that would give you that error.
Phil responds:
Posted: October 20th, 2008 at 4:22 pm →
Thanks Mike,
But as I said, I checked the config file several times.
The line below is copied direct from the uploaded version of the CONFIG.php file (but anonymised as it’s publicly posted here):
$reply_email = “noreply@thedomaininquestion.co.uk”; // Reply email
If that’s not it, what ever could be going on?
Best wishes
Phil.
Mike Cherim responds:
Posted: October 20th, 2008 at 5:02 pm →
I have no idea then. The script looks to see that it’s changed and that’s it. Did you do some script modifications or something?
Kai Davis responds:
Posted: October 20th, 2008 at 5:48 pm →
Hi Mike,
Thanks for the script! I was wondering if you could shed a little more light onto Jody’s question. I wanted to remove the ’subject’ drop down box and have the email set to a default subject. I think this is doable, but I’m not sure where I would start.
Thanks,
Kai
Mike Cherim responds:
Posted: October 20th, 2008 at 6:12 pm →
As I told Jodi you need to select a fixed variable and just hardcode it in the script. If you’ll keep the subject then it’s even simpler for you since you won’t need edit the mail line. Not sure what else to explain. I don’t offer free support for folks wanting to alter the script.
Phil responds:
Posted: October 20th, 2008 at 6:50 pm →
Hi Mike,
No, I made no changes at all to the script - that’s not the sort of thing I’m capable of.
I guess my only route now is to start with another fresh download and take it step by step again.
Best wishes
Phil responds:
Posted: October 23rd, 2008 at 8:12 am →
Phew,
Re-downloaded the script and set it up on the same domain and now it validates and the test form works. In the meantime I’d taken the precaution of purchasing a dedicated text editor, as I guessed that somehow the config file had got corrupted when editing. Though it was only fair to include this feedback on this page, to make it clear it was not a problem with the script!
So the page is up and the test form working in a different directory. So my next step is to create the real form based on my own site designs. I guess the simplest way ins to ‘include’ an edited-down test-form.
1. How do I remove the form information at the top of the page that includes: Form Version: v3 - Build Number: B3.20081002.01 - Model Number: SASU - Blocked: 0 - Help »? I guess the bar itself is needed to indicate successful submission and error states.
2. Am I right in thinking that to achieve the layout you already have, I need a css file which includes your css file, plus the css styling in the of the page?
3. Is there anything else I should delete from the test form for security or operational reasons?
4. If I’m ‘including’ the file in a page, do I need the of the page, as there will already be a in the main page the form is ‘include’d in.
Thanks for your help.
Phil responds:
Posted: October 23rd, 2008 at 8:14 am →
Sorry, my typing was appalling! What I meant to say was:
4. If I’m ‘including’ the file in a page, do I need the “” of the form page, as there will already be a “” in the main page the form is ‘include’d in.
Phil responds:
Posted: October 23rd, 2008 at 8:16 am →
No, it’s not my typing, it’s the form removing things inside anglebrackets.
This is what I meant: 4. If I’m ‘including’ the file in a page, do I need the anglebracket-head-anglebracket of the form page, as there will already be a anglebracket-head-anglebracket in the main page the form is ‘include’d in.
Mike Cherim responds:
Posted: October 23rd, 2008 at 8:40 am →
That’s typical of many blogs, Phil. If you want to post code use character entities to make your angle brackets, like this:
<
make<
and>
makes>
.The test form includes the form.php into into itself. The test form should be deleted once tested. Make your contact page and just include the form.php into it, just like the test form does. Make sense?
As far as text editors, I write all my code with NotePad. You’re right, though, if you used Word, Front Page, Dreamweaver, etc. all can bastardize PHP. This is noted multiple times throughout the documentation!
Phil responds:
Posted: October 23rd, 2008 at 8:57 am →
Thank Mike,
I didn’t twig to form.php being included in test-form!
I was actually using notepad, but I wonder if I had word-wrap turned on.
Now I’ve bought EditPadPro which seems pretty intelligent, and along with the more expensive UltraEdit and notepad++ was one of the top three in a survey I came across.
Thanks for your help. Now to create the form page…
Best wishes
Phil.
Mike Cherim responds:
Posted: October 23rd, 2008 at 9:07 am →
I’ve heard Notepad ++ is great, Phil. I have a bookmark for them (and have for two years)… haven’t gotten it yet You’re right, word wrap can mess you up. I never wrap when coding but I can’t as that would seriously screw me up.
Phil responds:
Posted: October 23rd, 2008 at 10:13 am →
Sorry Mike,
I still need a bit of handholding…!
Bear in mind that validation went fine for the script, and the test form worked OK…
I’ve ‘included’ the form.php file in my page using , it’s in a .shtml file which my host requires for includes, and it’s obviously ‘including’ the file because its contents appear in the Dreamweaver ‘design’ window. But when I run the page remotely I get:
[an error occurred while processing this directive] and my error logs show: “unable to include file “../gbcf-v3/form.php” in parsed file…”
Have I missed something?
Best wishes
Phil.
Phil responds:
Posted: October 23rd, 2008 at 10:15 am →
Sorry, that should be
I’ve ‘included’ the form.php file in my page using angle-bracket–#include file=”../gbcf-v3/form.php” –angle-bracket…
Phil responds:
Posted: October 23rd, 2008 at 10:31 am →
aha,
Just noticed something.
Shouls form.php be moved to the directory where the page including it is?
If so, if Dreamweaver asks to update links, should you say yes or no?
And do I need to change any path in form.php?
I’ve just noticed that there are several other error messages saying that files cannot be found which are not included in the main page, so must be coming from the included form.
Could you point me in the right direction please?
Thanks
Phil.
Phil responds:
Posted: October 23rd, 2008 at 10:46 am →
Hi again,
Moved the form.php both with and without letting Dreamweaver update the links, and obviously the include link is working, because I’m now getting an error-message on the page: Direct File Access Prohibited
Any help you can give would be appreciated.
Phil.
Phil responds:
Posted: October 23rd, 2008 at 10:51 am →
PS:
Logfiles show that the system can’t find the pages:
public_html/pages/
Phil responds:
Posted: October 23rd, 2008 at 11:11 am →
Oh no, I’ll try again:
Logfiles show that the system can’t find the pages:
public_html/pages/”left-arrow-bracket”
and public_html/pages/styles
Mike Cherim responds:
Posted: October 23rd, 2008 at 12:02 pm →
Hi Phil, after all that I still don’t quite understand. If you have errors saying a file can’t be found then your path to said file is wrong. There’s no need to put the form.php into the same folder as your contact page.
Mike Cherim responds:
Posted: October 23rd, 2008 at 12:04 pm →
By the way, if this is your include (as seen in the email notification),
<!--#include file="../gbcf-v3/form.php" -->
, that’s not how an include function is written. Do it the way it’s done in the readme, just edit the path to find your files.Phil responds:
Posted: October 23rd, 2008 at 1:36 pm →
Hi,
Thanks for responding. I used the style of include I did because when I used the one specified it did not work either! I have another include on the page (which is on every page) calling another html file from the shtml file, and that’s working fine.
I’ve now checked and corrected the paths and added the include with the correct path to form.php to the body. I’ve even tried creating a totall blank html document with only the gbcf-v3 code in the head and the include in the body. But each time I now simply get a blank page.
I’ve re-checked by error logs, and this is the result:
[Thu Oct 23 18:22:22 2008] [warn] Cannot get media type from ‘cgi-script’
Oddly enough this is exactly the same error that I was getting with another php script I’ve been trying to install.
Like this one, it was installed exactly as per instructions, but with this same error and a blank screen. Yet my ISP insists everything is fine on the php installation, with php running as a cgi.
I hope this is more coherent. Can you offer any advice?
Thanks
Phil.
Phil responds:
Posted: October 23rd, 2008 at 2:11 pm →
Hi Mike,
I thought I’d submitted another post, but it seems to have vanished!
I originally used the style I did for the include because I couldn’t get it to work the way suggested, and I already had another include working on the page in that fashion.
I’ve corrected all the paths, and added the specified include, and even created a blank html page with only the css/script information for gbcf-v3 in the head, and only the include in the body.
When I run the page, I just get a blank page, and my error logs give me:
[warn] Cannot get media type from ‘cgi-script’
I’ve been reading around and discovered a page that suggests that this error might be related to the fact that my host runs PHP as a cgi, so a php.ini is needed in the shared hosting account to resolve the problem. But what should be in the php.ini?
I’m totally at sea now, because I can’t understand why the test-form works, but a blank page form doesn’t.
Any help you can give would be appreciated.
Thanks
Phil responds:
Posted: October 23rd, 2008 at 2:14 pm →
PS: In the css and script references in the header, < and > be used instead of the right and left arrow brackets, because when I try to validate the page at the W3C validator, it does not validate with them as arrow brackets.
Mike Cherim responds:
Posted: October 23rd, 2008 at 2:55 pm →
Phil, I have absolutely no idea what the issue is. Sorry. Much of what you wrote does nothing but confuse me more. As an example, your mention of writing an include differently. You wrote it as a comment and that’s not any PHP I’m familiar with. And what your cgi_bin has to do my form is beyond me.
Phil responds:
Posted: October 23rd, 2008 at 5:25 pm →
Thanks for being so straight about it Mike.
The include I used was from an actual tutorial on the web, but for includes on html pages. The other include is an html include on an html page.
Having read further, can the include you propose only be used within a php page?
I too am totally baffled by the cgi reference, and so, it seems, is everyone else on the web. It seems it has been cropping up in relation to a repeated collection of different php scripts where php is running under suexec as a cgi script in a shared hosting environment.
But the disturbing thing is that wherever it’s occurred (I must have read a dozen different threads) nobody comes up with an answer. For someone as new to even using php scripts as I am, this is not only disturbing but distressing. But I’m faced with the same problem each time. The authors know about their scripts, the hosts know about their installation, but because there are no clearer error messages, neither can get to the bottom of it.
I’ll let you know if I find the solution.
Best wishes
Mike Cherim responds:
Posted: October 23rd, 2008 at 6:52 pm →
@Phil: You can use the
include_once()
function provided in the readme on a *.html page if the server is configured to do so (ask your host). Otherwise the page must end in *.php (be sure to update your navigation).This is given already in the FAQs. Please read them and the documentation I have already written. Stop making me rewrite it here, please. Also, please ask your web host to help you. If they cannot help then, please, get a new host because they obviously suck. Thank you.
Phil responds:
Posted: October 24th, 2008 at 10:32 am →
Hi Mike,
Success! The form is fully styled and working!
It may not appear so from the background above, but I’m an avid reader of manuals, help files, faqs and other documentation. But because of my lack of experience, my brain does not always grasp the significance of each piece of information. Sometimes I think I’ve understood, and when it doesn’t work, I then try something else, which is what happened above. I was convinced that my host’s knowledgebase said that naming a file .shtml was enough to get includes working. Which was why I took the action above. But apparently you need an .htaccess file. Once added to the directory, the script works like magic.
Thanks for your patience and help.
Best wishes
Phil.
Mike Cherim responds:
Posted: October 24th, 2008 at 12:25 pm →
Good to hear it, Phil.
jo responds:
Posted: October 25th, 2008 at 1:34 pm →
Hi,
many thanks for an excellent form! It worked first time but I need to remove the “country” name and input field. How do I do that please?
Mike Cherim responds:
Posted: October 25th, 2008 at 1:54 pm →
You could just comment it out in the form.php. If it’s blank if left empty it won’t print in the email. Or you could hardcode a fixed value like USA or something.
HaiHappen responds:
Posted: October 28th, 2008 at 8:52 am →
Hello,
can i use this plug-in twice in one word-press blog?
i need it a second time with less fields. only name, email and comment field.
thank u and best regards from germany
Mike Cherim responds:
Posted: October 28th, 2008 at 9:25 am →
Right now this version is not ready for use as a WordPress plugin. The other form, the WP build of v2, is a plugin, but can only be configured once per blog.
HaiHappen responds:
Posted: October 28th, 2008 at 9:35 am →
Thank u for this answer. I mean the WP build.
Is it possible to make a copy of the plugin-folder and only “rename” something to use it twice??
like:
plugin-folder:
wp-gbcf
wp-gbcf2
??
Mike Cherim responds:
Posted: October 28th, 2008 at 10:18 am →
No, sorry, the data is still the same and that version does referrer matching so the same data can’t be used. If you have other WP form questions, please post them in the appropriate place.
Patrizia Sabatini responds:
Posted: November 7th, 2008 at 12:39 pm →
Hi Mike, and thanks for the fantastic script. I am making a dual language website, and I need the form to be either in Italian or English depending what the user selects. I know I could put two copies of the script in different directories, but I’m sure there’s a better way.
I don’t know much about PHP but I’m learning. Is there a way to pass the $language variable from my calling page?
I really appreciate any advice you could give me.
-patrizia
Mike Cherim responds:
Posted: November 7th, 2008 at 1:02 pm →
Hi Patrizia, I’m not sure of how-to, exactly, but I think it could be done. Somehow you’d have to intercept the language file calling between the file and the the functions so that when an HTTP request is made on the form page (by loading and submitting). This would be facilitated by whatever means you’re using to control language prefs for each use. If by a cookie as I would assume, that should be doable. If not, which could be problematic should you want to upgrade the form in the future, then the other option would be to have two versions and the user could call from page level the version needed by whatever you’ve set up to allow this. Just be sure to change the
$set_directory
variable in the few places needed (commented in files) to prevent crossover.Steve S responds:
Posted: November 11th, 2008 at 6:09 am →
I have a problem. I have a Japanese Contact form. Everything works great for which I am very grateful. Except: When I send the form locally (with MAMP php set up on a MAc) the mail I sent to the webmaster (me) the Subject Line in the header is clear In Japanese letters, BUT when I do the same on the ISP’s webserver the letter sent by the form to the webmaster has the subject in Garbage Text ie. Japanese fonts not rendering. All files have UTF-8 encoding. I even changed all fonts on the CSS where possible to Japanese fonts.
The ja file is fantastic, I was translating the en file myself, not too easy for me.
Other letters I receive from the ISP with Japanese subject lines are OK.
Any ideas appreciated
steve
Okinawa
Mike Cherim responds:
Posted: November 11th, 2008 at 9:32 am →
Hmm. Since it’s plain text quotable, maybe a Japanese character set needs to be used (the charset is for the email) so that the email content will stay intact. Can you try that please? Instead of UTF-8.
steve responds:
Posted: November 11th, 2008 at 10:51 am →
Hi Mike
Thanks for the response. I tried changing the Char set on the config, form and test.php pages to all available JA char sets. This did not change the response e mail. But did mess up the rendering of the test.php page. Also this caused the body text of the email to be garbage on IE7, I put the Config Char set back to UTF-8 and the body text became readable. Also on IE 7 only, the subject after the bracketed words, do not show up.
To summarize with settings back to UTF-8. this is what I get:
Thanks again.
Steve
Okinawa
Mike Cherim responds:
Posted: November 11th, 2008 at 11:30 am →
The character set only affects the email, not what’s on the web page, so I don’t know where those other results are coming from. I don’t really know what the trouble is. The fellow who authored the Japanese language file doesn’t have these issues. You might want to contact your web host to see if they have any ideas.
jo responds:
Posted: November 11th, 2008 at 4:10 pm →
Hi,
I was wondering how I can change the colour of the asterisk (*) on required fields. At the moment it is red and I need to make if different!
Many thanks in advance. Your most humble servant! - Jo )
Mike Cherim responds:
Posted: November 11th, 2008 at 4:45 pm →
That’s the label error color as seen in the config file. You can change it there to another hex value.
Paul responds:
Posted: November 19th, 2008 at 12:04 pm →
Hi Mike -
I’ve uploaded your form and it seems to load properly. I’ve directed it to send email to a godaddy account that redirects it. I know the forwarding is working because I can send directly to it and it arrives properly. However I can’t seem to get your form to send it even though it says it’s successful. I also don’t receive a copy of the email I’ve sent, though I’ve requested one. Any thoughts? Here’s my link: http://tinyurl.com/5wcrfg
Thanks
Paul
Mike Cherim responds:
Posted: November 19th, 2008 at 12:26 pm →
Try downloading the latest copy. It was updated yesterday with something that might help.
Dan responds:
Posted: November 20th, 2008 at 12:45 pm →
Quality tool, used an old php form script for my contact page on a few website I have done but this has become my main tool of choice. Easy install and no spam!!! Great!!
Mike Cherim responds:
Posted: November 20th, 2008 at 1:06 pm →
Thanks Dan!
from Holland responds:
Posted: November 24th, 2008 at 2:52 pm →
Anybody familiar with this error:
Warning: mail() [function.mail]: SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE in /home/xxx/domains/xxx.nl/public_html/gbcf-v3/files/functions.php on line 1139
What can I do make it work?
Mike Cherim responds:
Posted: November 24th, 2008 at 3:22 pm →
Try the
ini_set()
in the config. Do ask your host for the info first though.Gary Miller (in Drymen, Scotland) responds:
Posted: November 27th, 2008 at 8:56 am →
Hi Mike,
Thanks for the script! I’ve been looking for a really good, accessible (free!) script like this for ages…now, by accident, I find the perfect solution. For a non-programmer like myself, it’s relatively easy to set up - just as long as you follow the installation and configuration instructions carefully.
Wonder if you could help with one teeny weeny problem please…
When I process the form with required fields missing and hit submit, the correct page comes up listing the missing fields OK. Unfortunately, instead of being a neat horizontal line with the errors listed in a linear fashion, it becomes an ugly, large rectangle with the errors listed vertically. I’ve been up most of the night with this and am rapidly losing what little hair I have left!
The form can be found here, don’t worry about the layout of the rest of the page as I’ve still yet to style the contents.
Any ideas please?
Cheers!
Mike Cherim responds:
Posted: November 27th, 2008 at 9:27 am →
I view the generated source and whatever being used to manage your site is adding all sorts of markup to your links. I mean a ton of stuff, b tags, all sorts of stuff. I have no idea what you’re using but the output (not generated by my script) is causing that problem.
Gary Miller (in Drymen, Scotland) responds:
Posted: November 27th, 2008 at 9:44 am →
Mike,
Thanks for the swift response! Sorry, I should have checked the generated source as a matter of course…please understand that it was a loooooong night!
I’m using niftyCorners to add rounded corners to various items on the page. Works perfectly with everything else and it appears that is where the problem lies. Off for a close scrutiny of the scripts/css involved.
Thanks again,
Cheers!
Gary Miller (in Drymen, Scotland) responds:
Posted: November 27th, 2008 at 11:18 am →
Mike,
Previous post seems to have disappeared into the Akismet void. The generated source is a result of Nifty Cube. But I’ve located the problem…I was looking in the wrong direction altogether. A missing tag was the problem. Only excuse I have is one of tiredness.
I certainly never meant to cast any slur on such a fine script. *smile*
Thanks for the response.
Cheers!
Mike Cherim responds:
Posted: November 28th, 2008 at 4:11 pm →
Hi Gary. Sorry about Akismet. I do wish it generated a more user friendly error since it does offer false positives at time. I try to check my Akismet queue daily, but we had a holiday here yesterday. It sounds like NiftyCorners needs to be more specific or somehow told not to apply all that code to every link.
Gary Miller responds:
Posted: November 29th, 2008 at 7:09 am →
Mike,
Of course…I forgot…Happy Thanksgiving!
I’m trying to do something about NiftyCorners. I’ve managed to cut out a lot of the generated source but whatever the script is applied to it seems to generate the extra code.
One other quick question please; any idea why the required asterisks aren’t showing up on the form? I’ve looked the script over several times now, but can’t quite put my finger on it.
Many thanks.
Mike Cherim responds:
Posted: November 29th, 2008 at 10:27 am →
Thanks Gary. Lookin’ a lot better. In the config look for this variable: Added Required Field Notes. Make that yes and the asterisks should show up. I don’t recall if that hides the legends or not. You’ll have to see. If they do go away they are still there, just hidden off screen. Doing that should also add required text to the main label. See my own use contact form to see.
Gary Miller (in Drymen, Scotland) responds:
Posted: December 1st, 2008 at 3:22 pm →
Mike,
Thanks…that’s got its sorted. I appreciate the feedback and help. I can’t afford much as I’m unemployed at present, but I will be making a donation in the next 4 or 5 days.
Thanks again for a really great script!
Mike Cherim responds:
Posted: December 1st, 2008 at 5:08 pm →
Awesome Gary. Glad it’s all worked out. And thanks in advance for the donation.
James responds:
Posted: December 11th, 2008 at 7:27 pm →
Hi,
Is it possible to show a more detailed UA?
I’d like to see this:
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
vs:
UA: Firefox on Windows
Mike Cherim responds:
Posted: December 11th, 2008 at 7:39 pm →
You comment out the section of the script that converts the full string to the abbreviated string it should return the full results you want. I figured most folks won’t really benefit from all that data so shortened it. Let me know if that works.
James responds:
Posted: December 11th, 2008 at 8:59 pm →
Hi,
I found this in settings.php but am not sure what to do to be honest:
### Sniff browsers to return a better string
Mike Cherim responds:
Posted: December 11th, 2008 at 9:21 pm →
Actually try this instead. Near the bottom of functions.php, where the emails are built, you’ll see a string that starts like this:
$mail_content = "$mail_content\n\n $timestamp_text: $ltd\n IP: $ip\n UA: $nua\n ISP: $hst\n Ref: $hr\n
ETC…Change the
UA: $nua\n
part of it toUA: $ua\n
and that should give you the whole string.James responds:
Posted: December 12th, 2008 at 9:09 am →
Thank you, that worked.
Cole responds:
Posted: December 16th, 2008 at 7:23 am →
I would like to alter the text “Enter your info in this form to send us an email”, but cannot find it anywhere in any of the php files. Can you help me?
Mike Cherim responds:
Posted: December 17th, 2008 at 3:25 pm →
Sorry for the delay. Big storm here. No power for six days (so far). Edit that text in your language file, Cole.
Tim responds:
Posted: December 17th, 2008 at 11:50 pm →
Hey Mike! Awesome work, and it’s much appreciated. I’d really like to be able to use v3 as standalone on a WordPress page (even if not as a plugin) — is this something I could help with? I’ve looked through your scripts, but instead of devoting miles of time trying to get up to speed on it like you are — what’s the hangup? Is it in the functions, the set_directory, in passing the relative URL / permalink structure from WP to the form?
If there’s some way I could contribute labor-wise, I’d be glad to help.
Mike Cherim responds:
Posted: December 18th, 2008 at 1:31 am →
Hi Tim, and thanks. I would imagine that it’d not be too difficult to do it in WP as a template, of via a less streamlined method, but I really haven’t looked into it. I’m waiting on the next production volley from Mike Jolley, but v3 for WP is in the works so my focus is geared in that direction.
Tim responds:
Posted: December 18th, 2008 at 2:51 pm →
Ah well. I fiddled around with it for awhile and got it to “work” (meaning show up) on a template page by changing set_directory to the template path in form.php and functions.php, but I’m guessing something in the way WP (2.7) redirects/rewrites to display theme content is confusing the form action. I couldn’t figure out how to get the posted data back to the gbcf script to send the mail and display the success message - kept getting a 404, even though my browser’s showing it’s at the right page.
Bah-humbug. I’ll just wait for the Experts to release the plugin. Merry Christmas (or whatever you might be celebrating)!
Mike Cherim responds:
Posted: December 18th, 2008 at 3:18 pm →
Hi Tim. Try playing around with the form action variable, putting the URL of the page the form is on. That should solve that issue. Let me know if that works.
Tim responds:
Posted: December 18th, 2008 at 5:38 pm →
Thanks for the response! I did try that, but failed … WP comes back with a 404 Not Found. In my case, I have the form on a page with a bare-bones page template: header, content (with gbcf form), sidebar and footer and my permalink structure lists pages directly from the top level: i.e. www.mysite.com/page
Changing form_action in CONFIG.php to the full theme directory (wp-content/themes/mytheme/my-template.php) fails because it bypasses the WP engine. Changing form_action to the page name (/page or even /page/) is equivalent to what gbcf does naturally, and results in a 404. Changing form_action to a full URL to the page (http://www.mysite.com/page) is equivalent to the previous configuration - results in a 404. I also tried http://www.mysite.com/?page_id=1 and http://www.mysite.com/index.php?page_id=1 (with my appropriate page number, of course) and get the same 404.
I’m guessing it’s got something to do with the rewrite for “purty” permalinks, which I don’t want to give up for SEO etc. OR… it has to do with passing the POST info through the WP engine to display the theme. I’m guessing maybe the latter since a standard structure passing the page_id with GET fails the same way… ?
Tim responds:
Posted: December 18th, 2008 at 5:39 pm →
Should have included: the form does show… the 404 is after form submission.
Tim responds:
Posted: December 18th, 2008 at 5:44 pm →
D’oh! Another correction… using the standard structure ?page_id=number results in “sorry, no posts matched your criteria” — not a 404.
Mike Cherim responds:
Posted: December 18th, 2008 at 6:43 pm →
I really don’t know then. I suspect, as you wrote:
Sorry it didn’t work out — would’ve been nice if you got it.
John responds:
Posted: December 18th, 2008 at 8:58 pm →
Hello Mike,
I started using your script on our website and it has worked successfully. Recently, we migrated our site to a new server (same host) that supports php 5.2.6. Using the script, with same configuration settings for the new server, the form has has stopped functioning. The form page loads properly, but after filling the form and submitting it, the user is redirected to the main page of the site, not the designated thank you url page. No email is sent as a result of the form submission. Oddly, if the test-form page is filled and submitted, an email is sent (but the thank you url is not opened). I’ve checked the server error log, no errors. I’m having no other email or server issues. I’m also in conversation with the software support that is used on our site. Any ideas or suggestions?
http://www.greencardepot.com/index.php?a=28&b=147
Thanks for your help,
John
Tim responds:
Posted: December 18th, 2008 at 9:19 pm →
Aha! I found this link over at the WP Support Forums: http://wordpress.org/support/topic/182955
Looks like using name=”name” in an input field conflicts with something going on in WP’s SOP.
So…. I changed the name name (ha ha) to “gbcf-name” in the input field of form.php and in functions.php where it picks up the post data, and
*drumroll*
I’ve got my Mojo back, yeah, baby!
All one has to do (at least all *I* had to do in WP 2.7 with a custom theme) tp make gbcf-v3 work in a WP page template is change:
In form.php:
$set_directory = "gbcf-v3";
and
name="name" value=”" size=”32″ maxlength=”" id=”name”>
to something like
$set_directory = "wp-content/themes/mytheme/gbcf-v3";
and
name="gbcf-name" value=”" size=”32″ maxlength=”" id=”name”>
and in functions.php:
$set_directory = "gbcf-v3";
and
$name_value = clean_var($_POST['name‘]);
to something like
$set_directory = "wp-content/themes/mytheme/gbcf-v3";
and
$name_value = clean_var($_POST['gbcf-name‘]);
Might be a good proposition going forward to add a “gbcf” or some other kind of unique-ifying label to the input names, etc… No?
Thanks again for taking the time to think about it, and I hope this helps you in some way.
Tim responds:
Posted: December 18th, 2008 at 9:28 pm →
Argh. I’m a terrible commenter….. Let’s try this again, switching with HTML codes….
In form.php:
$set_directory = "gbcf-v3";
and
<input type="text" class="text-med" name=”name” value=”<?php echo $name_value; ?>” size=”32″ maxlength=”<?php echo $name_len; ?>” id=”name”<?php echo $name_border; ?><?php echo $x_or_h; ?>><?php echo $add_break; ?>
to something like
$set_directory = "wp-content/themes/mytheme/gbcf-v3";
and
<input type="text" class="text-med" name=”gbcf-name” value=”<?php echo $name_value; ?>” size=”32″ maxlength=”<?php echo $name_len; ?>” id=”name”<?php echo $name_border; ?><?php echo $x_or_h; ?>><?php echo $add_break; ?>
and in functions.php:
$set_directory = "gbcf-v3";
and
$name_value = clean_var($_POST['name‘]);
to something like
$set_directory = "wp-content/themes/mytheme/gbcf-v3";
and
$name_value = clean_var($_POST['gbcf-name‘]);
Mike Cherim responds:
Posted: December 19th, 2008 at 12:46 am →
@John: The error is probably headers already sent, but it’s silenced so it wouldn’t show up in your log. All I can advise is to be clever with the language file and the style sheet — as some have done — and make a great thank you message on that page. It works for some, but not for others, all depends on site type (here’s why, first para). But I’m not sure that it was worth it now, lol. To re-enable error reporting if you need to confirm, it’s the @ symbol before the
header()
function strings. They can be found near the very bottom of the functions.php file.@Tim: Ah, they have “name” in use. That figures. The WP version of this form won’t have that issue as its magic happen will occur in a separate “wordpress.php” file. The actual form script won’t change offering a much easier way for updating, distribution, and allowing other systems to interface with it… i.e. drupal.php, etc., just like WP. That’s a good quick, easy, and effective fix so thank you very much for sharing it. I guess if someone wants to add it to WP now, it seems you’ve paved the how-to way.
Tim responds:
Posted: December 19th, 2008 at 2:05 am →
*hearing Indiana Jones theme music*
At least I’ve paved the way for something.
Dunno if it’s useful or not, but I really appreciate the GB contact form. Thanks again, for taking the time to notice.
Tim responds:
Posted: December 19th, 2008 at 2:12 am →
Oh! If you want to see it in action, you can go to http://finallycreative.com/contact
Upgraded to ridiculous, self-indulgent commenter… not just terrible
Mike Cherim responds:
Posted: December 19th, 2008 at 5:39 am →
Awesome job, man.
Ed Boal responds:
Posted: January 31st, 2009 at 1:55 pm →
Hi Mike
This script has now become ‘the’ framework script I use for developing forms for my clients projects. I just have one question - how do you change the text in the form labels? Which PHP file are these stored in? I want ‘Referred by’ to read as something else?
Thanks for this script.
Ed
Mike Cherim responds:
Posted: January 31st, 2009 at 2:32 pm →
Hi Ed. That’d be in the language file you’re using. Open it with a text editor like notepad or via your server admin or FTP, edit as needed. That’s it.
Anton responds:
Posted: February 9th, 2009 at 4:00 pm →
Brilliant! It looks great, and can’t wait to test it out.
What I really would like to know, is how to create a Thankyou page, so that I can set the option to “yes”. It would be even better it the Thankyou page could be personalized, e.g. if someone called “Anton” submitted the form, the Thankyou page says “Thank you Anton, for completing the form…”. I’ll be the first to admit that my knowledge of PHP is zero, so a complete code example would be much appreciated. I can then copy and paste into a new file.
Thanks in advance!
Mike Cherim responds:
Posted: February 9th, 2009 at 4:27 pm →
A thank you page has nothing to do with the form. It’d be something you’d make just like making an “About” page if you needed/wanted one of those. As far as the customization of such, the default set-up does personalize but the data isn’t forwarded or retained after that point to it’d involve some scripting to make that so. That said, with a little creative CSS work and language file edits, the default setup can be heavily customized.
Anis responds:
Posted: February 10th, 2009 at 8:49 am →
Hello,
thank you for sharing your contact form, it’s a great script and i like it.
It’s working very well on a classic lamp server (and maybe iis, i didn’t try) but i have a problem with a specific (i would say strange) mutual hosting.
The host use apache but when i try to chmod 666 the log file, it doesn’t work. All the files have xxx rights (which means nothing i guess) so i thing it’s an apache server installed on a microsoft server (2003 or whatever)
So in this specific hosting environment, the error “Environmental Error: The error log file, error-log.txt, is not writable! Set CHMOD to 666.” is showing and there’s no way to change the chmod.
I don’t know if php can write in the error-log file, maybe so, but chmod 666 will never happened on this server.
Mike Cherim responds:
Posted: February 10th, 2009 at 9:17 am →
I would ask the host. There must be some way to set permissions to the file. In a shared environment maybe login as the superadmin, though not allowing admins to set permissions on file seems excessively restrictive.
Alex Quinn responds:
Posted: February 10th, 2009 at 12:54 pm →
Hi Mike,
Must say, great form and fantastic site/community.
Just wondering if you’d thought about having a field to validate the email address that someone has entered?
Or even if this has already been done by someone?
Thanks,
Alex
Mike Cherim responds:
Posted: February 10th, 2009 at 2:19 pm →
Hi Alex. That has been requested a couple of times, one of those annoying re-enter your email address inputs, but I never acted on the suggestion. I suppose it’s never had great appeal to me since I’m usually annoyed by those. I always whine, but I just entered the damn thing. I know they’re looking out for me. After all if I get the address wrong they won’t be able to send me marketing offers, but I always get it right the first time. I can see the logic more clearly when entering passwords since the characters of obfuscated, but for emails never. I can see what I input.
Jeremy Carlson responds:
Posted: February 17th, 2009 at 2:55 pm →
Hi Mike,
This is a great script. I haven’t seen anything else which seems to cover all the bases so well. I did have a contribution to suggest - adding tabindex to the various fields.
I figured some folks might not want to use tabindex, or might, for various reasons, want to start w/ a higher number than 1, or step by more than 1 (okay, not really sure why, but JUST IN CASE…)
Here’s how I did it:
1) In the CONFIG file, I added these lines:
$tabindex = TRUE; // TRUE or FALSE
$tabstart = ‘1′; // Edit to start w/ a higher #
$tabinterval = ‘1′; // Wanna go by 10s? Change this.
2) Then I created a function in functions.php - we’ll see how this code works for the comment form here:
function tab() {
global $tabindex, $tabstart, $tabinterval;
if ($tabindex) {
echo “tabindex=\”$tabstart\”";
$tabstart = $tabstart+$tabinterval;
}
}
3) Finally, I just added a php block w/ ‘tab();’ to the beginning of all input, select, and textareas, then took that back out of the honeypot and hidden input fields.
Now my contact form tabs gracefully through in the order I want, etc.
Thanks again for the form, and looking forward to the WP v3.
-Jeremy
Mike Cherim responds:
Posted: February 17th, 2009 at 3:53 pm →
Hi Jeremy. Thanks for the suggestion. I do have tabindex on all v2 builds, but honestly it caused more problems than not. Lot’s of people abused and misused it and it resulted in a lot of support requests. Since tabindex is something only 1 in a 1000 developers only really need to use (normal tab order is expected by users and is generally best), I decided to leave it out of this version altogether.
Justin responds:
Posted: February 18th, 2009 at 5:02 pm →
Hi Mike,
Great script! One quick question … how can I turn off the anti-spam question (I know, why turn it off … but I have my reasons)?
Thanks again for your work!
Mike Cherim responds:
Posted: February 18th, 2009 at 5:44 pm →
Hi Justin. Down and dirty: open the form.php file and manually enter the answer value into that input (instead of it being empty), then comment the whole thing out so it won’t show up on the page. That should do it and there enough other controls to still offer you protection.
Mike Cherim responds:
Posted: February 21st, 2009 at 10:46 am →
Attention: There is a new post for form support. Please use it to post your comments, questions or suggestions. Please, however, review the comments above first to see if your question or concern has been addressed already. Thank you.