| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,340
|
What the...blank emails?
OK, so I finally added a mail form to my site - with a PHP script to process the HTML form. It works great. Until I checked my Gmail just a minute ago and I found 18 emails from "devnull@kundenserver.de" - all blank from 5:28AM (all of 'em). I believe this "kundenserver" has something to do with my current domain registrar, Schlund & Partners through 1&1 (can't beat 3 free years!). Anyway, I'm not sure if and how I can stop this. Here's the PHP script... PHP Code:
Is there and if/then statement I can add to this like - "IF $email='devnull@kundenserver.de' THEN..." end or error or something. I don't really know PHP, I just got this script somewhere or other - I had used it on another site for a friend, but he never said anything about getting blank emails? Perhaps is just something isolated with 1&1 and/or Schlund/Partner - in which case, I'm OK - because I submitted a request for a change of registrar to Go Daddy and will be getting new hosting as soon as that comes through. Thanks in advance! |
|
|
|
|
|
#2 (permalink) |
|
unusual suspect ™
Join Date: Jul 2004
Location: DE, USA
Posts: 3,155
|
Does the form work otherwise when you test it? Did the e-mail from devnull@kendenserver.de have your subject line? (ie could it just be coincidence) |
|
|
|
#4 (permalink) |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,572
|
Don't bother singling out a particular sender. Set it up to test the fields first - if they're blank, don't send. www.hotscripts.com |
|
|
|
#5 (permalink) | |
|
Senior Member
Join Date: Jan 2005
Posts: 12,340
|
Quote:
You're a quick one aren't you? Much appreciated, I'll look into it. |
|
|
|
|
#6 (permalink) |
|
shit happens
|
How are you setting up the HTML for the form? Are you using action="some.php(ie your form processing php script)" or are you using action="$PHP_SELF" to tell it to process the form using the PHP on the same page as the form? I had a similar problem when I used this in that every visitor to the page generated an email automatically, whether they had filled in the form or not. Solved it by putting the processing php into its own file and setting the action to "mail.php" or something similar. May not be this, but just an idea. |
|
|
|
#7 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,340
|
Thanks for the help everyone! So prompt, too! I need to get to bed now... I think I've fixed it, but if you're still curious how I've set it up, DRAGLiNE, here you go... There are three HTML pages (used to be 2) contact.html, error.html, and thanks.html - they are, of course, styled with CSS - quite a bit of CSS, actually... HTML Code:
And the NEW PHP looks like this...I just found a few tutorials on error checking forms and threw them together logically - even though I know absolutely no PHP - and it worked! PHP Code:
I wish my email really was "myemail@gmail.com"! Geez, with all this extra programming and error and thanks pages - my site's up to a whopping 200KB!!! |
|
![]() |