Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Contact Form - Testing? (Getting messages with no comments)

Featured Replies

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.

  • 2 weeks later...
  • 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.

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 by BrowserBugs

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?

  • 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

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.
}
  • 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.

  • 2 weeks later...
  • 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 by Grant Barker

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.