help for validating forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • chandni
    Second Lieutenant

    • Mar 2006
    • 113

    help for validating forms

    hello there i have this form the link is the fields marked in this form with an * name, second name are mandatory fields. i have created a form i.e. the second link which should be called when any of the mandatory fields is left blank. the second page which i have created says hit the back button of your browers and fill in the name. please help me with the script so that when i click on the submit button the form should check if the mandatory fields are not left empty. secondly, i have a doubt. i have two fields which are mandatory. do i have to create two seperate pages one to validate name and second to validate the second name. or just one form can do the work.

    http://www.leximindia.com/info.html



    many thanks
    chandni
  • davidundalicia
    General

    • Mar 2006
    • 6294

    #2
    Re: help for validating forms

    Hi chandni:
    Your http://www.leximindia.com/infovalidation.html
    form is perfect.

    copy your existing php form here and someone will take a look and advise you. (put xxxx@xxxx.com in your email address before you post the php)
    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

    • chandni
      Second Lieutenant

      • Mar 2006
      • 113

      #3
      Re: help for validating forms

      thanks for you reply but i am confused.. where do i take the php from...
      many thanks
      chandni

      Comment

      • nick1346
        Major

        • Jan 2006
        • 314

        #4
        Re: help for validating forms

        Hi There,

        You can find the php file in your public html folder in your ftp manager. To get that open blue voda, click on tools, ftp manger,go into your public html folder and you'll find it there as contactus1.php, save that to your hard drive then cut and paste that into a post here.
        Nick

        Comment

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #5
          Re: help for validating forms

          If i understand well, chandni has not yet created and uploaded a php script. He's asking for one, i'm i correct?
          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

          • chandni
            Second Lieutenant

            • Mar 2006
            • 113

            #6
            Re: help for validating forms

            yes navaldesign, the php script to validate is what i requested for. can u please help me with the php script. and where should i add this php script.

            thanks
            chandni

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #7
              Re: help for validating forms

              Ok, i'll preapare a script for you. When i'll have it ready, you must upload it to your site using BlueFTP. I'll post back for you.
              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

              • chandni
                Second Lieutenant

                • Mar 2006
                • 113

                #8
                Re: help for validating forms

                i shall wait for ur script, many thanks navaldesign u have been very helpful

                chandni

                Comment

                • navaldesign
                  General & Forum Moderator

                  • Oct 2005
                  • 12080

                  #9
                  Re: help for validating forms

                  Sorry, just found out that your fields are not named correctly. They are named T1, T2 etc. Please give your fields real names, like "Name", Surname" etc. and then republish and 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

                  • chandni
                    Second Lieutenant

                    • Mar 2006
                    • 113

                    #10
                    Re: help for validating forms

                    i am sorry about that navaldesign i have republised the page with real names...
                    many thanks
                    chandni

                    Comment

                    • navaldesign
                      General & Forum Moderator

                      • Oct 2005
                      • 12080

                      #11
                      Re: help for validating forms

                      Ok, i'll let you 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

                      • navaldesign
                        General & Forum Moderator

                        • Oct 2005
                        • 12080

                        #12
                        Re: help for validating forms

                        Hi,

                        here it goes:

                        <?php
                        // Receiving variables
                        @$Tittle = addslashes($_POST['Tittle']);
                        @$Name = addslashes($_POST['Name']);
                        @$Surname = addslashes($_POST['Surname']);
                        @$Companyname = addslashes($_POST['Companyname']);
                        @$Address1 = addslashes($_POST['Address1']);
                        @$state = addslashes($_POST['state']);
                        @$Address2 = addslashes($_POST['Address2']);
                        @$City = addslashes($_POST['City']);
                        @$country = addslashes($_POST['country']);
                        @$pin = addslashes($_POST['pin']);
                        @$email = addslashes($_POST['email']);
                        @$telephone = addslashes($_POST['telephone']);
                        // Validation
                        if (strlen($Name) == 0 )
                        {
                        header("Location: infovalidation.html");
                        exit;
                        }
                        if (strlen($Surname) == 0 )
                        {
                        header("Location: infovalidation.html");
                        exit;
                        }
                        if (strlen($Companyname) == 0 )
                        {
                        header("Location: infovalidation.html");
                        exit;
                        }
                        if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                        {
                        header("Location: infovalidation.html");
                        exit;
                        }
                        if (strlen($email) == 0 )
                        {
                        header("Location: infovalidation.html");
                        exit;
                        }
                        if (strlen($telephone) == 0 )
                        {
                        header("Location: infovalidation.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 = "Info Submited by our Web Information Request Form";
                        $pfw_email_to = "youremail@leximindia.com";

                        $pfw_message = "----------------------------------------------------\n"
                        . "Tittle: $Tittle\n"
                        . "Name: $Name\n"
                        . "Surname: $Surname\n"
                        . "Companyname: $Companyname\n"
                        . "Address1: $Address1\n"
                        . "Address2: $Address2\n"
                        . "City: $City\n"
                        . "state: $state\n"
                        . "country: $country\n"
                        . "pin: $pin\n"
                        . "email: $email\n"
                        . "telephone: $telephone\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");
                        ?>


                        1. Copy the code and paste it in Notepad. Change the email adress to be your own email address in your Vodahost account.
                        2. Create a "thankyou" page in BV. Save it as "thankyou_page". Publish it.
                        3. Go to "Save as", choose "File type", select "All files", and save it as "contactus1.php". Upload it on the server using Blue FTP. DO NOT PASTE IT IN ANY BV PAGE.
                        4. If in the future you need to create different error pages for every error, just change this line:
                        header("Location: infovalidation.html");
                        after every field validation.
                        5. You may want to avoid your visitors having to press the browser "Back" button. You can insert a "Back button" directly in your "infovalidation" page by either inserting an Advanced Button (BV,>Insert>Form>Advanced Button, make it "On click", give it action "Go to the previous Page", OR you can insert an HTML box in your page, and paste in it the following code:
                        <FORM>
                        <input type="button" class="but" value="< BACK TO THE FORM " onclick=history.go(-1)>
                        </FORM>

                        Let me know if everything has worked out ok.
                        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

                        • navaldesign
                          General & Forum Moderator

                          • Oct 2005
                          • 12080

                          #13
                          Re: help for validating forms

                          Forgot: change the encoding of your form in "multipart / form data" save it and republish it.
                          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

                          • chandni
                            Second Lieutenant

                            • Mar 2006
                            • 113

                            #14
                            Re: help for validating forms

                            ur a genuis navaldesign thank you so much.....
                            regards
                            chandni

                            Comment

                            Working...
                            X