Announcement

Collapse
No announcement yet.

Help on "Validating Form Elements"!

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

  • Help on "Validating Form Elements"!

    "Naval" says I need to start a NEW Thread on this.......

    I need help understanding "Validating Form Elements".

    I've been able to copy & paste alot of scripts, but the instructions for this one is "crazy"!

    -I've already added the script for the "php mailto page".
    And this script works great! (All the fields are labeled correctly and
    are coming thru via email correctly). I probably should leave well
    enough alone!!!!!!! -BUT-
    -Now I want to add another feature that will make sure customers use
    valid email addresses & don't forget to fill out any important fields.
    -I tried to use the directions that Navel posted, but It's not working.
    (I tried for over 4hrs - working & re-working it with no success!)

    The only things -that I may have not understood are the following:
    1) Does this new script replace the script I already have in place "php mailto page" -or- do I add it in addition to? (And if so, into which page?) the original form, or the thank you confirmation page or the (new) error_email?
    2) Will the script work if I "copy & paste"?
    3) I'm confused on what I'm suppose to copy as the "Actual Script" (to make it work) apposed to "Directions within script"!!!!

    I 'cut' the fields that didn't apply to my form & added the ones that did - but still couldn't get it to work.


    This is the page I'm trying to verify fields on: (the submit page)
    http://www.cateryourparty.com/menu.html

    Dazed & Confused,
    Debbye


  • #2
    Re: Help on "Validating Form Elements"!

    If you go into http://www.cateryourparty.com/menu.html,
    you will not see the script in question is not there, (I deleted it) as it was not working.
    I need "EXPLICIT" instructions (and I'm sure most people will agree), to make this work!

    Thanks,
    Debbye

    Comment


    • #3
      Re: Help on "Validating Form Elements"!

      Hi Debbye

      Dazed and confused, yep thats forms for you.
      I'm probably not the best person to be answering this but I'll have a go.
      If you have a new script you should replace the old one. I take it that you have a complete script for the form including the validation that you want or are you trying to splice some code into an existing script?
      If it's a complete script upload it into your public folder using the ftp manager. Then alter the action field in the properties box for your form to look for this script and upload it. Remeber to ensure that you save the script as a .php file and not a .txt file before you publish it as it won't work otherwise.
      Cutting and pasting works but be carefull that you copy all of the relevant bits, a missed bracket can play havoc with things!
      Keep at it!
      Nick

      Comment


      • #4
        Re: Help on "Validating Form Elements"!

        Ok Debby, which are your required fields ?
        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


        • #5
          Re: Help on "Validating Form Elements"!

          My required fields are:

          email
          name
          location_of_party
          contact_phone
          date_of_party
          number_of_guests
          how_did_you_hear_about_us?

          Thanks naval!
          Debbye

          Comment


          • #6
            Re: Help on "Validating Form Elements"!

            I've created an "error page" for email errors...http://www.cateryourparty.com/error_email.html
            if it's (not) suppose to be a html.........You'll also see out there http://www.cateryourparty.com/error_email.php
            I was trying all kinds of ways to make it work. (sorry)

            I want to also create (1) more error page that will be generic for all the other fields.......Will that work ok?

            Thanks,
            Deb

            Comment


            • #7
              Re: Help on "Validating Form Elements"!

              Ok, i'll provide you with the script. Please note that it's going to be rather long, as you have many fields. Before we go on, please let me know if the order in which you receive the answers is the desired and correct one. If not, you will have to re-make your form in this way:

              Open the form page in BV
              Open another, blank page.

              Copy and paste the form to the new page.
              Copy and paste all the fields, IN THE PRECISE ORDER THAT YOU WANT YOUR ANSWERS AND YOUR TAB TO WORK.

              Save the old form page as "menu_old"
              Save the new page as "menu"
              Publish it.
              Let me know.

              Whether you will make one or more error pages for the rest of the fields, is up to you. Think as if you were one of your clients: will a single error page point him directly to his error or he's to loose time to find out? However you can change the script yourself to change the error pages if you want. Just let me know
              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


              • #8
                Re: Help on "Validating Form Elements"!

                The order is correct (the way I gave them to you).

                And I just created http://www.cateryourparty.com/error_page.html
                for validating all the other fiields. I'll try just this (1) for now......however, I understand what you are saying...........may be better for the customer to know "exactly" what field they forgot! (an error page for each field!)

                I'll be waiting for your script!

                Thanks so much,
                Debbye

                Comment


                • #9
                  Re: Help on "Validating Form Elements"!

                  [Here is your script:
                  change youremail@yourdomain.com with your real email in your Vodahost account. Also change the "thankyou_page.html" with your actual confirmation or thankyou page name.

                  Copy all the script, paste it in notepad, goto to "Save as" , choose "File Type:" "All Files" and save it as "confirmationpage.php". Please save it in another location in your computer, so you want get confused with the old one.Upload it on the server. You're done.

                  <?php
                  // Receiving variables
                  @$location_of_party = addslashes($_POST['location_of_party']);
                  @$name = addslashes($_POST['name']);
                  @$contact_phone = addslashes($_POST['contact_phone']);
                  @$date_of_party = addslashes($_POST['date_of_party']);
                  @$number_of_guests = addslashes($_POST['number_of_guests']);
                  @$how_did_you_hear_about_us? = addslashes($_POST['how_did_you_hear_about_us?']);
                  @$email = addslashes($_POST['email']);
                  @$questions = addslashes($_POST['questions']);
                  @$hotdogs = addslashes($_POST['hotdogs']);
                  @$hot_sausage = addslashes($_POST['hot_sausage']);
                  @$kielbasa = addslashes($_POST['kielbasa']);
                  @$yellow_mustard = addslashes($_POST['yellow_mustard']);
                  @$ketchup = addslashes($_POST['ketchup']);
                  @$relish = addslashes($_POST['relish']);
                  @$brown_mustard = addslashes($_POST['brown_mustard']);
                  @$saurerkraut = addslashes($_POST['saurerkraut']);
                  @$hotdog_chili = addslashes($_POST['hotdog_chili']);
                  @$hotdog_cheese = addslashes($_POST['hotdog_cheese']);
                  @$onions = addslashes($_POST['onions']);
                  @$onion_sauce = addslashes($_POST['onion_sauce']);
                  @$hamburgers = addslashes($_POST['hamburgers']);
                  @$boneless_chicken_breasts = addslashes($_POST['boneless_chicken_breasts']);
                  @$meatballs = addslashes($_POST['meatballs']);
                  @$sliced_roastbeef = addslashes($_POST['sliced_roastbeef']);
                  @$roasted_chicken_pieces = addslashes($_POST['roasted_chicken_pieces']);
                  @$hot_wings = addslashes($_POST['hot_wings']);
                  @$pulled_pork = addslashes($_POST['pulled_pork']);
                  @$bbq_ribs = addslashes($_POST['bbq_ribs']);
                  @$potato_salad = addslashes($_POST['potato_salad']);
                  @$redskin_potato_salad = addslashes($_POST['redskin_potato_salad']);
                  @$coleslaw = addslashes($_POST['coleslaw']);
                  @$baked_beans = addslashes($_POST['baked_beans']);
                  @$macaroni_salad = addslashes($_POST['macaroni_salad']);
                  @$pasta_salad = addslashes($_POST['pasta_salad']);
                  @$baked_macaroni_cheese = addslashes($_POST['baked_macaroni_cheese']);
                  @$corn_on_the_cob = addslashes($_POST['corn_on_the_cob']);
                  @$tossed_salad = addslashes($_POST['tossed_salad']);
                  @$fresh_greenbeans = addslashes($_POST['fresh_greenbeans']);
                  @$sliced_watermelon = addslashes($_POST['sliced_watermelon']);
                  @$fruit_salad = addslashes($_POST['fruit_salad']);
                  @$peach_cobbler = addslashes($_POST['peach_cobbler']);
                  @$*****_crisp = addslashes($_POST['*****_crisp']);
                  @$banana_pudding = addslashes($_POST['banana_pudding']);
                  @$cheese_cake = addslashes($_POST['cheese_cake']);
                  @$carrot_cake = addslashes($_POST['carrot_cake']);
                  @$brownies = addslashes($_POST['brownies']);
                  @$cookies = addslashes($_POST['cookies']);
                  @$sheet_cake = addslashes($_POST['sheet_cake']);
                  @$lettuce_tomato_pickle_onion_tray = addslashes($_POST['lettuce_tomato_pickle_onion_tray']);
                  @$sliced_cheese_tray = addslashes($_POST['sliced_cheese_tray']);
                  @$sliced_meat_tray = addslashes($_POST['sliced_meat_tray']);
                  @$cubed_meat_cheese_tray = addslashes($_POST['cubed_meat_cheese_tray']);
                  @$platter_fresh_fruit = addslashes($_POST['platter_fresh_fruit']);
                  @$vegetable_tray = addslashes($_POST['vegetable_tray']);
                  @$antipasta_tray = addslashes($_POST['antipasta_tray']);
                  @$shrimp_platter = addslashes($_POST['shrimp_platter']);
                  @$deviled_eggs = addslashes($_POST['deviled_eggs']);
                  @$potato_chips = addslashes($_POST['potato_chips']);
                  @$tortilla_chips = addslashes($_POST['tortilla_chips']);
                  @$cheese_curls = addslashes($_POST['cheese_curls']);
                  @$pretzels = addslashes($_POST['pretzels']);
                  @$club_crackers = addslashes($_POST['club_crackers']);
                  @$petite_chip_mix = addslashes($_POST['petite_chip_mix']);
                  @$sourcream_onion_dip = addslashes($_POST['sourcream_onion_dip']);
                  @$ranch_dip = addslashes($_POST['ranch_dip']);
                  @$french_onion_dip = addslashes($_POST['french_onion_dip']);
                  @$spinach_dip = addslashes($_POST['spinach_dip']);
                  @$salsa_dip = addslashes($_POST['salsa_dip']);
                  @$texas_chili = addslashes($_POST['texas_chili']);
                  @$clam_chowder = addslashes($_POST['clam_chowder']);
                  @$chicken_noodle_soup = addslashes($_POST['chicken_noodle_soup']);
                  @$broccoli_cheese_soup = addslashes($_POST['broccoli_cheese_soup']);
                  @$italian_wedding_soup = addslashes($_POST['italian_wedding_soup']);
                  @$canned_sodas = addslashes($_POST['canned_sodas']);
                  @$spring_water = addslashes($_POST['spring_water']);
                  @$juice_boxes = addslashes($_POST['juice_boxes']);
                  @$fresh_lemonade = addslashes($_POST['fresh_lemonade']);
                  @$fresh_iced_tea = addslashes($_POST['fresh_iced_tea']);
                  @$hot_coffee = addslashes($_POST['hot_coffee']);
                  @$hot_chocolate = addslashes($_POST['hot_chocolate']);
                  @$margarita_machine = addslashes($_POST['margarita_machine']);
                  @$cotton_candy_machine = addslashes($_POST['cotton_candy_machine']);
                  @$snocone_machine = addslashes($_POST['snocone_machine']);
                  @$popcorn_machine = addslashes($_POST['popcorn_machine']);
                  @$nacho_machine = addslashes($_POST['nacho_machine']);
                  @$italian_water_ice = addslashes($_POST['italian_water_ice']);
                  @$dippin_dots = addslashes($_POST['dippin_dots']);
                  // Validation
                  if (strlen($location_of_party) == 0 )
                  {
                  header("Location: error_page.html");
                  exit;
                  }
                  if (strlen($name) == 0 )
                  {
                  header("Location: error_page.html");
                  exit;
                  }
                  if (strlen($contact_phone) == 0 )
                  {
                  header("Location: error_pagel.html");
                  exit;
                  }
                  if (strlen($date_of_party) == 0 )
                  {
                  header("Location: error_page.html");
                  exit;
                  }
                  if (strlen($number_of_guests) == 0 )
                  {
                  header("Location: error_page.html");
                  exit;
                  }
                  if (strlen($how_did_you_hear_about_us?) == 0 )
                  {
                  header("Location: error_page.html");
                  exit;
                  }
                  if (strlen($email) == 0 )
                  {
                  header("Location: error_email.html");
                  exit;
                  }
                  if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                  {
                  header("Location: error_email.html");
                  exit;
                  }
                  // Find Server date and Time
                  $date = date("l jS F Y, g:i A");

                  // Find Browser and IPaddress
                  $browser =$_SERVER['HTTP_USER_AGENT'];

                  $ip = $_SERVER['REMOTE_ADDR'];

                  //Sending Email to form owner
                  $pfw_header = "From: $email\n"
                  . "Reply-To: $email\n";
                  $pfw_subject = "New Menu Order";
                  $pfw_email_to = "youremail@yourdomain.com";
                  $pfw_message = "email: $email\n"
                  . "name: $name\n"
                  . "location_of_party: $location_of_party\n"
                  . "contact_phone: $contact_phone\n"
                  . "date_of_party: $date_of_party\n"
                  . "number_of_guests: $number_of_guests\n"
                  . "$how_did_you_hear_about_us?\n"
                  . "questions: $questions\n"
                  . "\n"
                  . " Menu order\n"
                  . "-----------------------------------------------------\n"
                  . " Hot Entree's Served From Our Authentic Hotdog Carts \n"
                  . "-----------------------------------------------------\n"
                  . "hotdogs: $hotdogs\n"
                  . "hot_sausage: $hot_sausage\n"
                  . "kielbasa: $kielbasa\n"
                  . "yellow_mustard: $yellow_mustard\n"
                  . "ketchup: $ketchup\n"
                  . "relish: $relish\n"
                  . "brown_mustard: $brown_mustard\n"
                  . "saurerkraut: $saurerkraut\n"
                  . "hotdog_chili: $hotdog_chili\n"
                  . "hotdog_cheese: $hotdog_cheese\n"
                  . "onions: $onions\n"
                  . "onion_sauce: $onion_sauce\n"
                  . "--------------------------------------------------------\n"
                  . "Hot Entree's Served From Stainless Steel Chafing Dishes\n"
                  . "--------------------------------------------------------\n"
                  . "hamburgers: $hamburgers\n"
                  . "boneless_chicken_breasts: $boneless_chicken_breasts\n"
                  . "meatballs: $meatballs\n"
                  . "sliced_roastbeef: $sliced_roastbeef\n"
                  . "roasted_chicken_pieces: $roasted_chicken_pieces\n"
                  . "hot_wings: $hot_wings\n"
                  . "pulled_pork: $pulled_pork\n"
                  . "bbq_ribs: $bbq_ribs\n"
                  . "-------------------------------------------------------------\n"
                  . " Side Dishes \n"
                  . "-------------------------------------------------------------\n"
                  . "potato_salad: $potato_salad\n"
                  . "redskin_potato_salad: $redskin_potato_salad\n"
                  . "coleslaw: $coleslaw\n"
                  . "baked_beans: $baked_beans\n"
                  . "macaroni_salad: $macaroni_salad\n"
                  . "pasta_salad: $pasta_salad\n"
                  . "baked_macaroni_cheese: $baked_macaroni_cheese\n"
                  . "corn_on_the_cob: $corn_on_the_cob\n"
                  . "tossed_salad: $tossed_salad\n"
                  . "fresh_greenbeans: $fresh_greenbeans\n"
                  . "-------------------------------------------------------------\n"
                  . " Desserts\n"
                  . "-------------------------------------------------------------\n"
                  . "sliced_watermelon: $sliced_watermelon\n"
                  . "fruit_salad: $fruit_salad\n"
                  . "peach_cobbler: $peach_cobbler\n"
                  . "*****_crisp: $*****_crisp\n"
                  . "banana_pudding: $banana_pudding\n"
                  . "cheese_cake: $cheese_cake\n"
                  . "carrot_cake: $carrot_cake\n"
                  . "brownies: $brownies\n"
                  . "cookies: $cookies\n"
                  . "sheet_cake: $sheet_cake\n"
                  . "-------------------------------------------------------------\n"
                  . " Cold Platters\n"
                  . "------------------------------------------------------------- \n"
                  . "lettuce_tomato_pickle_onion_tray: $lettuce_tomato_pickle_onion_tray\n"
                  . "sliced_cheese_tray: $sliced_cheese_tray\n"
                  . "sliced_meat_tray: $sliced_meat_tray\n"
                  . "cubed_meat_cheese_tray: $cubed_meat_cheese_tray\n"
                  . "platter_fresh_fruit: $platter_fresh_fruit\n"
                  . "vegetable_tray: $vegetable_tray\n"
                  . "antipasta_tray: $antipasta_tray\n"
                  . "shrimp_platter: $shrimp_platter\n"
                  . "deviled_eggs: $deviled_eggs\n"
                  . "-------------------------------------------------------------\n"
                  . " Dips & Chips\n"
                  . "------------------------------------------------------------- \n"
                  . "potato_chips: $potato_chips\n"
                  . "tortilla_chips: $tortilla_chips\n"
                  . "cheese_curls: $cheese_curls\n"
                  . "pretzels: $pretzels\n"
                  . "club_crackers: $club_crackers\n"
                  . "petite_chip_mix: $petite_chip_mix\n"
                  . "sourcream_onion_dip: $sourcream_onion_dip\n"
                  . "ranch_dip: $ranch_dip\n"
                  . "french_onion_dip: $french_onion_dip\n"
                  . "spinach_dip: $spinach_dip\n"
                  . "salsa_dip: $salsa_dip\n"
                  . "-------------------------------------------------------------\n"
                  . " Hot Soups \n"
                  . "-------------------------------------------------------------\n"
                  . "texas_chili: $texas_chili\n"
                  . "clam_chowder: $clam_chowder\n"
                  . "chicken_noodle_soup: $chicken_noodle_soup\n"
                  . "broccoli_cheese_soup: $broccoli_cheese_soup\n"
                  . "italian_wedding_soup: $italian_wedding_soup\n"
                  . "-------------------------------------------------------------\n"
                  . " Beverages\n"
                  . "-------------------------------------------------------------\n"
                  . "canned_sodas: $canned_sodas\n"
                  . "spring_water: $spring_water\n"
                  . "juice_boxes: $juice_boxes\n"
                  . "fresh_lemonade: $fresh_lemonade\n"
                  . "fresh_iced_tea: $fresh_iced_tea\n"
                  . "hot_coffee: $hot_coffee\n"
                  . "hot_chocolate: $hot_chocolate\n"
                  . "-------------------------------------------------------------\n"
                  . " Extra's To Make Your Party A Hit!\n"
                  . "-------------------------------------------------------------\n"
                  . "margarita_machine: $margarita_machine\n"
                  . "cotton_candy_machine: $cotton_candy_machine\n"
                  . "snocone_machine: $snocone_machine\n"
                  . "popcorn_machine: $popcorn_machine\n"
                  . "nacho_machine: $nacho_machine\n"
                  . "italian_water_ice: $italian_water_ice\n"
                  . "dippin_dots: $dippin_dots\n"
                  . "-------------------------------------------------------------\n"
                  . "Received on : $date\n"
                  . "Browser : $browser\n"
                  . "IP address : $ip\n"
                  . "-------------------------------------------------------------\n";

                  *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
                  header("Location: thankyou_page.html");
                  ?>
                  Last edited by navaldesign; 04-24-2006, 04:44 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


                  • #10
                    Re: Help on &quot;Validating Form Elements&quot;!

                    Ok Naval, all done. I followed each step you gave me above. Do you mind looking at it? For some reason i'm just getting a blank page when I click on the "Submit" button. Do I need to remove the "old" script I have inside the body tag of "confirmationpage.html"????? I think I may have some things wrong.

                    Almost done....I can feel it!
                    Thanks is certainly not enough!!!!!
                    Deb

                    Comment


                    • #11
                      Re: Help on &quot;Validating Form Elements&quot;!

                      Naval,
                      On
                      http://www.cateryourparty.com/confirmationpage.php - it says there is a Parse Error on line 264. Line 264 is the 4th line from the bottom.
                      Just "---------------------------/n"; Did I do something wrong? Please advise what I need to do to fix.

                      Thanks,
                      Deb

                      Comment


                      • #12
                        Re: Help on &quot;Validating Form Elements&quot;!

                        Yes, sorry, mu fault. Take the ";" off FROM LINE 263 (NOT from 264) so it will be
                        . "IP address : $ip\n". And hope you have created and published a "thank_page" or you have changed line 265 to an existing 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


                        • #13
                          Re: Help on &quot;Validating Form Elements&quot;!

                          Hi Naval,
                          I took off the ";" from line 263................saved & re-published, but I'm still getting an error message. I tried F5 about a zillion times, but I'm still not getting anywhere. And yes, I have a thank you page.
                          It's
                          http://www.cateryourparty.com/confirmationpage.html

                          Thanks,
                          Deb

                          Comment


                          • #14
                            Re: Help on &quot;Validating Form Elements&quot;!

                            Woooooooow, something isn't right! When I just clicked on the link I just gave you above, to my 'Thanks You Page' it took me to the php one.

                            Help,
                            Deb

                            Comment


                            • #15
                              Re: Help on &quot;Validating Form Elements&quot;!

                              Debby, you must have some error with copuing/pasting the code.
                              If you wish it, provide me your loggin info and i'll fix it for you.
                              My form is in www.navaldesign.info/feedback13.html
                              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

                              Working...
                              X