Results 1 to 12 of 12

Thread: Blank emails on some form submittions
      
   

  1. #1
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Blank emails on some form submittions

    Seldomly, but still enough to worry about, my client gets emails submitted from a form I made on his site that just reads:

    'Values submitted from web site form'

    There is no other information that comes through.

    His form page is http://www.steppin-out.co.uk/contact.html

    Please advise anyone?
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  2. #2
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Blank emails on some form submittions

    People are probably hitting the submit button without filling in any information. Add validation to the fields so it can't be submitted with empty data

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  3. #3
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    Quote Originally Posted by Watdaflip View Post
    People are probably hitting the submit button without filling in any information. Add validation to the fields so it can't be submitted with empty data
    Validation has always been there:

    A lot of the fields have to be filled in so that can't be the reason...
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  4. #4
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    Sorry I gave you the wrong form url. It's this one:

    http://www.steppin-out.co.uk/music_menu.html

    But as above, it DOES have questions that require filling in.
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Blank emails on some form submittions

    Since you already have validation, i can only suppose that someone is visiting your action.php page.It is enough to visit the action.php page, to recieve a blank email. You can avoid this either using a session, that will prevent the email submission if no session value is found by the script, or add a validation (in the php script) that will look at all fields, and if all of them are blank, it will not submit.

    Add this code as first line of your php script, immediately after <?PHP

    if ($_POST == ""){
    header ("Location: pagetogoto.html");
    exit;
    }


    replacing pagetogoto.html with the actual page name (can be an error page or simply the index page)
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  6. #6
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    When you say immediately after, like... next line?

    Like this:

    <?PHP
    if ($_POST == ""){
    header ("Location: index.html");
    exit;
    }
    $mailto = "enquiries@steppin-out.co.uk";
    $email = $HTTP_POST_VARS['email'];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Music Menu Contact Form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  7. #7
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Blank emails on some form submittions

    Correct.

    However, ABVFP will also perform php validation (those who have Javascript disabled in their browsers will not be able to override the built in Javascript validation) and will automatically perform also a form submission check.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  8. #8
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    Thanks George. I have made the change and hopefully this has now cured my client's problem. I knew you would be along to solve it soon!

    Many Thanks
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  9. #9
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Blank emails on some form submittions

    Sorry for this, the above code might not work in some cases, please replace it with this one:

    if (count($_POST) == 0){
    header ("Location: index.html");
    exit;
    }
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  10. #10
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    Quote Originally Posted by navaldesign View Post
    Sorry for this, the above code might not work in some cases, please replace it with this one:

    if (count($_POST) == 0){
    header ("Location: index.html");
    exit;
    }
    It didn't work, I had two more come through. I'll try the new code thank you.
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

  11. #11
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Blank emails on some form submittions

    Yes, this one works ok.

    At least one of the two blanks that you got was from me, maybe both, i don't remember
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  12. #12
    Marincky's Avatar
    Marincky is offline General
    Join Date
    Apr 2006
    Location
    Warwickshire, UK
    Posts
    4,564

    Default Re: Blank emails on some form submittions

    Ah ok, well thank you for your kind help anyway. It's greatly appreciated.
    Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49