---- Automatically Reject Comments If Website Field Filled In?
lucy24 - 8:30 pm on Jul 10, 2013 (gmt 0)
Was it a template page or a wordpress page?
Neither, unfortunately-- I'm looking at my own mail-processing form. But since I originally made it by cribbing code from, er, ahem, w3schools dot com, I'm assuming that any boilerplate code is similar. Someone who speaks php will have to step in, though; there are probably several ways of doing the same thing. In php there usually are.
Disclaimer: Obviously I don't speak WordPress. But I'm here assuming that although everything can happen with no human involvement, you've also got the option of looking at your raw php and making adjustments. If I'm mistaken on this, stop reading right here because I'll just be giving you a lot of disinformation :( In fact, moderators may want to bring out the scissors.
ONE: The contact system I've got uses two pages. The first one has the form your users fill in. It's an html form whose crucial line looks like this: <form name = "mailform" id = "mailform" action = "sendmail.php" method = "post"> You can look at your own contact page via View Source in your browser and see if there's anything like that. The exact names will be different, but there has to be a 'method="post"' element. Then, the second page-- the one here called sendmail.php-- contains all the _REQUEST business. That's where you look at the values of the various fields and stomp on users who give an impossible e-mail address or leave the Content area blank. In a CMS this is where the site picks between "Thanks for your input" and "Sorry, there was a problem". (At least I hope they do. Saying "Thank you for your comments. We were unable to send them" is not awfully helpful.)
TWO: After the human user clicks Submit or Send or equivalent, their browser makes contact with the site again, using the information in the "action" line. This comes through in logs as a request to your server. If you have never looked at raw logs, it's a useful thing to learn. They are alarming at first glance, but they all follow a pattern. Your host should keep them somewhere for at least a few days.
Now at this point there may be one of two things. Logs may say simply "POST sendmail.php" (or whatever the name of the page is) or they may say "POST sendmail.php?name=something&email=somethingelse&site=blahblah" and so on.
In the second scenario, you have a lot more options, because now there are two places you can intercept the request: either on the form-processing page, or in the server before your visitor even gets to the page.