August 21, 20169 yr Is there any way to check if a Contact form is working as it should, or if it is outdated and potentially less secure? It's not a WP site, it's a standard HTML5 CSS3 type form. If I fill out the form, it works for me. I keep noticing quite a few blank emails where the name and email address are included, but the main content area is empty. The website server is set to not delete or filter anything. Many of these seem to be Gmail addresses, but not all. The settings have always been the same, but I'm getting more empty emails recently. I could turn on the filter settings on the server to maybe limit these, if I could tell if they are spam. (I don't actually get many emails anyway via the site, but would like to receive and be able to read legit emails.) Or maybe I should include a checker to tell if the sender is human? I also noticed that you can type just a space in the comments field, and it allows it to send. As for php, I can't really tell a good or up-to-date script, from a bad or out-of-date one. Thanks for any advice.
September 1, 20169 yr Author It's kind of embarrassing when no one answers. Plus, I can't edit it either. Maybe there are too many I this, and I that.. or something. Sorry about that.
September 2, 20169 yr I'd suggest if it's some (not all) fields then I'm pretty sure it's an un-escaped / html converted character which is breaking it in those fields. As for blank / spaces to fill in the fields look into trim() for php. Edited September 2, 20169 yr by BrowserBugs
September 2, 20169 yr It's kind of embarrassing when no one answers. Without seeing the code involved it is impossible to give an accurate answer. Is there any code to prevent the form being submitted without all fields being completed?
September 3, 20169 yr My form works really well and easily, plus it has a good captcha. If you PM me I can email you the form to modify on your own site if you like? http://www.professionalwebdesigndirectory.com/html-contact-form.php Edited September 3, 20169 yr by neil0wen
September 4, 20169 yr Author Without seeing the code involved it is impossible to give an accurate answer. Is there any code to prevent the form being submitted without all fields being completed? Thanks for your replies everyone. I've attached a couple of example pages to show just the basic form html, and the php file that is being used. I've done this to try to learn more. This is an old script I've been using for a while. In the meantime, I will PM neilOwen and try out his form, which I'm sure must be more up to date compared to my decrepit efforts. Thank you. form-example-html.html contactformprocess-example.php
September 5, 20169 yr I'd say there's a lot of room for error here. $name = $_POST['name']; This is dangerous, nothing is done with it before inserting it into the mail and no validation checks are done. If my message had "It's a wonderful "day" today" I'd take a bet would probably send a blank email. Take a look at Neils mailer and see what validation is done prior to sending if you're learning, then read up on what each bit does to understand why it was used, I find this a good way of learning, e.g. if(trim($_POST['name'])=="") { // name field is empty. }
September 5, 20169 yr Author Yes, thank you. I agree it's a good way to learn too. I've actually been working on getting Neil's mailer to work the past few hours. He kindly sent me some files yesterday. It's tricky working on it (for me), but it's fun. Thanks.
September 6, 20169 yr Author I've updated the contact form (thanks to neilOwen for the files). Feel free to test it, if you like.
September 16, 20169 yr Author Any recommendations as to what to have as a contact form thank you page? contact page I like the idea of having a page which shows what the user typed and sent. (fisicx's page does that nicely) Maybe there's a script for that? Any other ideas are welcome. Feel free to test. (No one visits the site anyway.) (I intend to get around to a 1 or 2 column site layout and really minimize things, but I'd like to do a few other pieces step by step, too.) Thanks a lot for any advice. Edited September 16, 20169 yr by Grant Barker
Create an account or sign in to comment