Blank emails on some form submittions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Marincky
    General

    • Apr 2006
    • 4539

    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.
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    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

    Comment

    • Marincky
      General

      • Apr 2006
      • 4539

      #3
      Re: Blank emails on some form submittions

      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.

      Comment

      • Marincky
        General

        • Apr 2006
        • 4539

        #4
        Re: Blank emails on some form submittions

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



        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.

        Comment

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #5
          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!

          Comment

          • Marincky
            General

            • Apr 2006
            • 4539

            #6
            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.

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #7
              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!

              Comment

              • Marincky
                General

                • Apr 2006
                • 4539

                #8
                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.

                Comment

                • navaldesign
                  General & Forum Moderator

                  • Oct 2005
                  • 12080

                  #9
                  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!

                  Comment

                  • Marincky
                    General

                    • Apr 2006
                    • 4539

                    #10
                    Re: Blank emails on some form submittions

                    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.

                    Comment

                    • navaldesign
                      General & Forum Moderator

                      • Oct 2005
                      • 12080

                      #11
                      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!

                      Comment

                      • Marincky
                        General

                        • Apr 2006
                        • 4539

                        #12
                        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.

                        Comment

                        Working...
                        X