cant see the forest for the trees - verifying fields

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

    • Mar 2006
    • 6294

    cant see the forest for the trees - verifying fields

    Hi all,
    I am a great believer in self help and therefore have searched and read and viewed and visited other peoples websites who have had this same problem.
    .
    Using pablos very good description, I have created my contact.bvp form
    and also created my confirm.bvp form saved as php.
    Published both and all are working OK......
    .
    Now, I would like to have the 3 simple fields (name, email, and comments) verified using the (If strlen ) coding as found during above searches.
    .
    Is it just a case of adding these simple lines or is something else required as I
    keep getting error messages.
    .
    I have reverted to the original code for now
    until some kind person points me in the right direction......
    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:
  • Girlonthehill
    General

    • Oct 2005
    • 4193

    #2
    Re: cant see the forest for the trees - verifying fields

    Greetings David,

    Aren't they a nightmare? I've found this which deals with validation of correct format of email and a contact name:

    http://www.vodahost.com/vodatalk/for...ript-help.html Post #9

    One of Naval's, obviously, maybe you could check your validation bits against it? If it doesn't help - send up a flare!

    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

    • davidundalicia
      General

      • Mar 2006
      • 6294

      #3
      Re: cant see the forest for the trees - verifying fields

      Hi Amanda, where the heck are the flares !!!!!
      .
      its something simple like this that I am looking for

      if (strlen($COMMENT) == 0 )
      {
      header("Location: upload_error.html");
      exit;
      }

      but when I copy and paste into my existing confirm.bvp and republish as php
      thats when I get a the warning message.....

      I have viewed most of navals posts but all seem to involve notepad and ftp
      and I am trying to keep this simple......
      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

      • davidundalicia
        General

        • Mar 2006
        • 6294

        #4
        Re: cant see the forest for the trees - verifying fields

        oh.... heres my original script for those that cannot read my mind......oops
        .

        <?PHP
        $email = $HTTP_POST_VARS[email];
        $mailto = "me@myplace.com";
        $mailsubj = "Feedback from 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);
        ?>
        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

        • Girlonthehill
          General

          • Oct 2005
          • 4193

          #5
          Re: cant see the forest for the trees - verifying fields

          Originally posted by davidundalicia
          oh.... heres my original script for those that cannot read my mind......oops
          .

          <?PHP
          $email = $HTTP_POST_VARS[email];
          $mailto = "me@myplace.com";
          $mailsubj = "Feedback from 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);
          ?>
          The simplest way, for most, is to paste the script into notepad (start>all programs>accessories>notepad). Save as (change the file type to All Files) and save as example.php

          Open the file publish tool in any BV page (left hand menu - globe with arrow pointing north). Double click the box that appears and browse for your php file don't worry where on the page it is as it only acts as a basket to carry files and does not show up on the page). Then publish the BV page, as normal. When the page is successfully publish - delete the file upload box from your BV page.

          This should have placed your php script safely in your public.html folder (or wherever you have saved it) from where your pages can access it.

          If I am, in an effort to help, 'teaching my Grandmother to suck eggs', I apologise! I hope this does assist you.

          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

          • davidundalicia
            General

            • Mar 2006
            • 6294

            #6
            Re: cant see the forest for the trees - verifying fields

            Hi amanda,
            Please dont apologise as any reply is allways useful....

            The whole point of this exercise is to try and find a way to verify form fields
            without using notepad, ftp or the carrier. In other words, to continue the simple way of creating forms as described by Pablo and continued by Naval.
            .
            In my mind, there have been many, many posts for help on this same subject
            and if we could simplify this by using the publishing method then we would be helping a lot more people.....
            .
            I am fairly new with bv and vh but I am learning something new each day...
            Here is my latest attempt
            <?PHP
            @$name = addslashes($_POST['name']);
            @$email = addslashes($_POST['email']);
            if (strlen($name) == 0 )
            {
            header("Location: error.html");
            exit;
            }
            if (strlen($email) == 0 )
            {
            header("Location: error.html");
            exit;
            }
            if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
            {
            header("Location: error.html");
            exit;
            }
            $email = $HTTP_POST_VARS[email];
            $mailto = "admin@mvtinia.com";
            $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);
            ?>

            Can Anyone point me in the right direction ????
            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

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #7
              Re: cant see the forest for the trees - verifying fields

              <?PHP
              @$name = addslashes($_POST['name']);
              @$email = addslashes($_POST['email']);
              if (strlen($name) == 0 )
              {
              header("Location: error.html");
              exit;
              }
              if (strlen($email) == 0 )
              {
              header("Location: error.html");
              exit;
              }
              if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
              {
              header("Location: error.html");
              exit;
              }
              $email = $HTTP_POST_VARS[email]; Delete this line. You have already defined $email above
              $mailto = "admin@mvtinia.com";
              $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: thankyou_page.html");

              ?>

              All the rest seems correct, BUT YOU HAVE TO UPLOAD IT IN THE NOTEPAD METHOD: the headers in the script might conflict with the html code if you paste it in a BV page. That's why i have added the line in red
              Last edited by navaldesign; 04-25-2006, 08:02 PM.
              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

              • davidundalicia
                General

                • Mar 2006
                • 6294

                #8
                Re: cant see the forest for the trees - verifying fields

                Thanks naval, will try as you have suggested.....
                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

                • navaldesign
                  General & Forum Moderator

                  • Oct 2005
                  • 12080

                  #9
                  Re: cant see the forest for the trees - verifying fields

                  Please create and publish the thankyou page. You will need it to redirect the visitor after submission.
                  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

                  • davidundalicia
                    General

                    • Mar 2006
                    • 6294

                    #10
                    Re: cant see the forest for the trees - verifying fields

                    naval, I now have my contact page, my confirm page and a php file uploaded but with the below I still am getting a warning message....

                    can you check below.....thanks....

                    <?PHP
                    @$name = addslashes($_POST['name']);
                    @$email = addslashes($_POST['email']);
                    if (strlen($name) == 0 )
                    {
                    header("Location: error.html");
                    exit;
                    }
                    if (strlen($email) == 0 )
                    {
                    header("Location: error.html");
                    exit;
                    }
                    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                    {
                    header("Location: error.html");
                    exit;
                    }
                    $mailto = "admin@mvtinia.com";
                    $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: confirm.html");
                    ?>
                    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

                    • davidundalicia
                      General

                      • Mar 2006
                      • 6294

                      #11
                      Re: cant see the forest for the trees - verifying fields

                      Latest information......

                      name and email fields Verification are now working......thanks naval

                      Contact.bvp page (action=contact.php - method=post - encoding type=blank)

                      nameerror.html page - emailerror.html page - confirm.html page

                      contact.php

                      <?PHP
                      @$name = addslashes($_POST['name']);
                      @$email = addslashes($_POST['email']);
                      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;
                      }
                      $mailto = "admin@mvtinia.com";
                      $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: confirm.html");
                      ?>

                      ALL problems now resolved.........
                      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

                      Working...
                      X