Required Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • matrixxxxxx1
    Captain

    • Apr 2006
    • 221

    Required Fields

    Hi
    Is Naval Design around plzzzzz or any other expert

    I have my form up and running, but would like to add required fields to name and email. this is my contact link. http://www.atexflooring.ca/contact.html
    I went over some of the threads here on the subject, however I kept runing into errors.

    this is the script I have in there as of now.
    I appreciate any help you guys can offer

    Thnx

    mike

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@mydomain.ca";
    $mailsubj = "Inquiry form Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Customer Inquiry from Contact Us page:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    http://www.atexflooring.ca
    http://www.newfloor.ca
  • Girlonthehill
    General

    • Oct 2005
    • 4193

    #2
    Re: Required Fields

    Originally posted by matrixxxxxx1
    Hi
    Is Naval Design around plzzzzz or any other expert

    I have my form up and running, but would like to add required fields to name and email. this is my contact link. http://www.atexflooring.ca/contact.html
    I went over some of the threads here on the subject, however I kept runing into errors.

    this is the script I have in there as of now.
    I appreciate any help you guys can offer

    Thnx

    mike

    <?PHP
    $email = $HTTP_POST_VARS[email];
    $mailto = "me@mydomain.ca";
    $mailsubj = "Inquiry form Contact Us";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Customer Inquiry from Contact Us page:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    $mailbody .= "$key : $val\n";
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    I couldn't see your email on your site, but if you let me know it, I'll send you one of mine, that Naval did for me. You can then check line for line what you need. Would that help?

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


    Comment

    • matrixxxxxx1
      Captain

      • Apr 2006
      • 221

      #3
      Re: Required Fields

      Thnx Amanda

      mike@atexflooring.ca


      mike
      http://www.atexflooring.ca
      http://www.newfloor.ca

      Comment

      • Girlonthehill
        General

        • Oct 2005
        • 4193

        #4
        Re: Required Fields

        Originally posted by matrixxxxxx1
        Thnx Amanda

        mike@atexflooring.ca


        mike
        On it's way, Mike.

        VodaHost

        Your Website People!
        1-302-283-3777 North America / International
        02036089024 / United Kingdom
        291916438 / Australia

        ------------------------

        Top 3 Best Sellers

        Web Hosting - Unlimited disk space & bandwidth.

        Reseller Hosting - Start your own web hosting business.

        Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


        Comment

        • matrixxxxxx1
          Captain

          • Apr 2006
          • 221

          #5
          Re: Required Fields

          Originally posted by Girlonthehill
          On it's way, Mike.
          Thnx Amanda

          I'll have a look, hopefully I can figure it out.

          mike
          http://www.atexflooring.ca
          http://www.newfloor.ca

          Comment

          • Girlonthehill
            General

            • Oct 2005
            • 4193

            #6
            Re: Required Fields

            Originally posted by matrixxxxxx1
            Thnx Amanda

            I'll have a look, hopefully I can figure it out.

            mike
            Any time, hope it helps.

            VodaHost

            Your Website People!
            1-302-283-3777 North America / International
            02036089024 / United Kingdom
            291916438 / Australia

            ------------------------

            Top 3 Best Sellers

            Web Hosting - Unlimited disk space & bandwidth.

            Reseller Hosting - Start your own web hosting business.

            Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


            Comment

            • matrixxxxxx1
              Captain

              • Apr 2006
              • 221

              #7
              Re: Required Fields

              This is like trying to learn chinese for the first time....lol

              Thnx Amanda, but I don't quite get it from your file. It's loaded with commands.

              Thnx anyways

              Mike
              http://www.atexflooring.ca
              http://www.newfloor.ca

              Comment

              • Girlonthehill
                General

                • Oct 2005
                • 4193

                #8
                Re: Required Fields

                Originally posted by matrixxxxxx1
                This is like trying to learn chinese for the first time....lol

                Thnx Amanda, but I don't quite get it from your file. It's loaded with commands.

                Thnx anyways

                Mike
                Yeah, it's a big form but the validation is only on the email addresses and contact (I think), thought maybe you could work it out. If not Naval or another expert will be along shortly. Hang on in there...

                VodaHost

                Your Website People!
                1-302-283-3777 North America / International
                02036089024 / United Kingdom
                291916438 / Australia

                ------------------------

                Top 3 Best Sellers

                Web Hosting - Unlimited disk space & bandwidth.

                Reseller Hosting - Start your own web hosting business.

                Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                Comment

                • matrixxxxxx1
                  Captain

                  • Apr 2006
                  • 221

                  #9
                  Re: Required Fields

                  I made email error page and name error page with this script from naval from another thread, but no luck


                  <?PHP

                  @$email = addslashes($_POST['email']);
                  @$name = addslashes($_POST['name']);

                  // Validation for empty fields
                  if (strlen($email) == 0 )
                  {
                  header("Location: http://www.atexflooring.ca/email_errorpage.html");
                  exit;
                  }
                  if (strlen($name) == 0 )
                  {
                  header("Location: http://www.atexflooring.ca/name_errorpage.html");
                  exit;
                  }

                  $mailto = "mike@atexflooring.ca";
                  $mailsubj = "Contact Us";
                  $mailhead = "From: $email\n";
                  reset ($HTTP_POST_VARS);
                  $mailbody = "Values submitted from web site form:\n";
                  while (list ($key, $val) = each ($HTTP_POST_VARS))
                  {
                  $mailbody .= "$key : $val\n";
                  }
                  mail($mailto, $mailsubj, $mailbody, $mailhead);
                  ?>



                  I keep getting this error:

                  Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/feedback.php:7) in /home/xxxxxx/public_html/feedback.php on line 105


                  Helpppppppp


                  mike
                  http://www.atexflooring.ca
                  http://www.newfloor.ca

                  Comment

                  • Girlonthehill
                    General

                    • Oct 2005
                    • 4193

                    #10
                    Re: Required Fields

                    Originally posted by matrixxxxxx1
                    I made email error page and name error page with this script from naval from another thread, but no luck


                    <?PHP

                    @$email = addslashes($_POST['email']);
                    @$name = addslashes($_POST['name']);

                    // Validation for empty fields
                    if (strlen($email) == 0 )
                    {
                    header("Location: http://www.atexflooring.ca/email_errorpage.html");
                    exit;
                    }
                    if (strlen($name) == 0 )
                    {
                    header("Location: http://www.atexflooring.ca/name_errorpage.html");
                    exit;
                    }

                    $mailto = "mike@atexflooring.ca";
                    $mailsubj = "Contact Us";
                    $mailhead = "From: $email\n";
                    reset ($HTTP_POST_VARS);
                    $mailbody = "Values submitted from web site form:\n";
                    while (list ($key, $val) = each ($HTTP_POST_VARS))
                    {
                    $mailbody .= "$key : $val\n";
                    }
                    mail($mailto, $mailsubj, $mailbody, $mailhead);
                    ?>



                    I keep getting this error:

                    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/feedback.php:7) in /home/xxxxxx/public_html/feedback.php on line 105


                    Helpppppppp


                    mike
                    YIKES!!! I'm not that good at it either. I tried doing it myself a couple of weeks ago and messed it up royal. I think I should leave now and forget I ever helped you. Lol! You need expert help. Naval or someone else who understands it will be along soon - hold on in there. Sorry!

                    VodaHost

                    Your Website People!
                    1-302-283-3777 North America / International
                    02036089024 / United Kingdom
                    291916438 / Australia

                    ------------------------

                    Top 3 Best Sellers

                    Web Hosting - Unlimited disk space & bandwidth.

                    Reseller Hosting - Start your own web hosting business.

                    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                    Comment

                    • matrixxxxxx1
                      Captain

                      • Apr 2006
                      • 221

                      #11
                      Re: Required Fields

                      Thnx for trying Amanda. I Aprecaite your effort.

                      Mike
                      http://www.atexflooring.ca
                      http://www.newfloor.ca

                      Comment

                      • matrixxxxxx1
                        Captain

                        • Apr 2006
                        • 221

                        #12
                        Re: Required Fields

                        Where are all the experts???


                        Mike
                        http://www.atexflooring.ca
                        http://www.newfloor.ca

                        Comment

                        • davidundalicia
                          General

                          • Mar 2006
                          • 6294

                          #13
                          Re: Required Fields

                          mike,
                          Its a jungle.......
                          .
                          here is the simplest one that actually works.......
                          1 contact.bvp form
                          1 contact.php file (ftp to main directory)
                          3 error type .bvp forms.
                          1 confirm.bvp form
                          .
                          <?PHP
                          @$name = addslashes($_POST['name']);
                          @$email = addslashes($_POST['email']);
                          @$comments = addslashes($_POST['comments']);
                          if (strlen($name) == 0 )
                          {
                          header("Location: nameerror.html");
                          exit;
                          }
                          if (strlen($email) == 0 )
                          {
                          header("Location: emailerror.html");
                          exit;
                          }
                          if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                          {
                          header("Location: emailerror.html");
                          exit;
                          }
                          if (strlen($comments) == 0 )
                          {
                          header("Location: http://mvpalma1.com/sales/commenterror.html");
                          exit;
                          }
                          $mailto = "admin@mvtinia.com"; change this to your email
                          $mailsubj = "Feedback from mvpalma1 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))
                          {
                          $mailbody .= "$key : $val\n";
                          }
                          mail($mailto, $mailsubj, $mailbody, $mailhead);
                          header("Location: http://mvpalma1.com/confirm.html");
                          ?>

                          see them working at either of my 2 sites below...

                          Any probs, post again or you can email me....
                          Have fun
                          Regards..... David

                          Step by Step Visual Tutorials for the complete beginner
                          Newbies / Beginners Forum
                          FREE Membership Login Scripts: - Meta Tags Analyzer
                          My Social Networking Site - Free Contact Forms
                          Finished your New website!! Now get it noticed Here:

                          Comment

                          • matrixxxxxx1
                            Captain

                            • Apr 2006
                            • 221

                            #14
                            Re: Required Fields

                            Originally posted by davidundalicia
                            mike,
                            Its a jungle.......
                            .
                            here is the simplest one that actually works.......
                            1 contact.bvp form
                            1 contact.php file (ftp to main directory)
                            3 error type .bvp forms.
                            1 confirm.bvp form
                            .
                            <?PHP
                            @$name = addslashes($_POST['name']);
                            @$email = addslashes($_POST['email']);
                            @$comments = addslashes($_POST['comments']);
                            if (strlen($name) == 0 )
                            {
                            header("Location: nameerror.html");
                            exit;
                            }
                            if (strlen($email) == 0 )
                            {
                            header("Location: emailerror.html");
                            exit;
                            }
                            if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                            {
                            header("Location: emailerror.html");
                            exit;
                            }
                            if (strlen($comments) == 0 )
                            {
                            header("Location: http://mvpalma1.com/sales/commenterror.html");
                            exit;
                            }
                            $mailto = "admin@mvtinia.com"; change this to your email
                            $mailsubj = "Feedback from mvpalma1 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))
                            {
                            $mailbody .= "$key : $val\n";
                            }
                            mail($mailto, $mailsubj, $mailbody, $mailhead);
                            header("Location: http://mvpalma1.com/confirm.html");
                            ?>

                            see them working at either of my 2 sites below...

                            Any probs, post again or you can email me....

                            Thnx alot David, I appreciate your help
                            I did as you mentioned and it seemed to work right away, then i'm not sure what i did, but the problem I'm having now is it keeps redircting me to http://www.atexflooring.ca/www.atexflooring.ca/nameerror.html
                            http://www.atexflooring.ca/www.atexflooring.ca/emailerror.html
                            I can't get it to just go to www.atexflooring.ca/nameerror.html or www.atexflooring.ca/emailerror.html
                            it keeps going twice www.mydomain/error/www.mydomain/error
                            I checked the script over and over. I have no idea why it's doing that
                            The confirmation page is working but not the error pages due to links.

                            I just wanted to do name and email for required fields...Can you check this for errors plz

                            <?PHP
                            @$name = addslashes($_POST['name']);
                            @$email = addslashes($_POST['email']);
                            if (strlen($name) == 0 )
                            {
                            header("Location: www.atexflooring.ca/nameerror.html");
                            exit;
                            }
                            if (strlen($email) == 0 )
                            {
                            header("Location: www.atexflooring.ca/emailerror.html");
                            exit;
                            }
                            if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                            {
                            header("Location: www.atexflooring.ca/emailerror.html");
                            exit;
                            }
                            $mailto = "mike@atexflooring.ca";
                            $mailsubj = "Feedback from atex flooring form";
                            $mailhead = "From: $email\n";
                            reset ($HTTP_POST_VARS);
                            $mailbody = "Customer inquiry from contact us:\n";
                            while (list ($key, $val) = each ($HTTP_POST_VARS))
                            {
                            $mailbody .= "$key : $val\n";
                            }
                            mail($mailto, $mailsubj, $mailbody, $mailhead);
                            header("Location: http://atexflooring.ca/confirm.html");
                            ?>




                            mike
                            http://www.atexflooring.ca
                            http://www.newfloor.ca

                            Comment

                            • matrixxxxxx1
                              Captain

                              • Apr 2006
                              • 221

                              #15
                              Re: Required Fields

                              Finally It's working

                              David you're my hero
                              Thnx a bunch. I appreciate all your help.


                              Mike
                              http://www.atexflooring.ca
                              http://www.newfloor.ca

                              Comment

                              Working...
                              X