Announcement

Collapse
No announcement yet.

Form Script Assistance

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

  • #16
    Re: Form Script Assistance

    Probably your script is looking for some field that doesn't exist. I can't know, because the php code is not visible.
    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


    • #17
      Re: Form Script Assistance

      Originally posted by navaldesign View Post
      Probably your script is looking for some field that doesn't exist. I can't know, because the php code is not visible.
      <?php
      // Receiving variables
      @$name = addslashes($_POST['Name']);
      @$company = addslashes($_POST['Street']);
      @$city = addslashes($_POST['City']);
      @$province = addslashes($_POST['Province']);
      @$telhp = addslashes($_POST['TelHP']);
      @$email = addslashes($_POST['EMail']);
      @$question = addslashes($_POST['Message']);
      // Validation
      if (strlen($Name) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($Street) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($City) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($Province) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($TelHP) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($EMail) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      if (strlen($Message) == 0 )
      {
      header("Location: error2.htm");
      exit;
      }
      //Sending Email to form owner
      $pfw_header = "From: $email\n"
      . "Reply-To: $email\n";
      $pfw_subject = "Contact Us";
      $pfw_email_to = "xxxxx@xxxxx. com";
      $pfw_message = "Name: $Name\n"
      . "Street: $Street\n"
      . "city: $city\n"
      . "Province: $Province\n"
      . "Tel HP: $TelHP\n"
      . "E Mail: $EMail\n"
      . "Message: $Message\n";
      *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
      header("Location: confirmation2.htm");
      ?>

      Comment


      • #18
        Re: Form Script Assistance

        Ok-

        None of your variables match your form fields. This script will not work with that form.

        Go back to the drawing board- start over. Build if from scratch as Naval suggested. Make sure he variables, form fields and php script all match up. It is case sensitive. Therefore Name and name are two different things as far as the script is concerned.

        Andy
        PHP- is a blast!

        Comment


        • #19
          Re: Form Script Assistance

          Could not have explained it better.
          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


          • #20
            Re: Form Script Assistance

            I have corrected and check and recheck but still goes to error page.
            Could you please tell me, what still goes wrong? Thank you.

            <?php
            // Receiving variables
            @$Name = addslashes($_POST['Name']);
            @$Street = addslashes($_POST['Street']);
            @$City = addslashes($_POST['City']);
            @$Province = addslashes($_POST['Province']);
            @$TelHP = addslashes($_POST['TelHP']);
            @$EMail = addslashes($_POST['EMail']);
            @$Message = addslashes($_POST['Message']);
            // Validation
            if (strlen($Name) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($Street) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($City) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($Province) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($TelHP) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($EMail) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            if (strlen($Message) == 0 )
            {
            header("Location: error2.htm");
            exit;
            }
            //Sending Email to form owner
            $pfw_header = "From: $EMail\n"
            . "Reply-To: $EMail\n";
            $pfw_subject = "Contact Us";
            $pfw_email_to = "xxxx@xxx.kom";
            $pfw_message = "Name: $Name\n"
            . "Street: $Street\n"
            . "City: $City\n"
            . "Province: $Province\n"
            . "TelHP: $TelHP\n"
            . "EMail: $EMail\n"
            . "Message: $Message\n";
            *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
            header("Location: confirmation2.htm");
            ?>

            Comment


            • #21
              Re: Form Script Assistance

              You have not checked correctly:

              the email field is "E Mail" in the form, "Email" in the script.
              The Telephone is "Tel HP" in the form, "TelHP" in the script.
              "Post Code": it exists in the form, but not in the script.

              ALL variables should be the same between form and script. Copy the script from here:


              <?php
              // Receiving variables
              @$Name = addslashes($_POST['Name']);
              @$Street = addslashes($_POST['Street']);
              @$City = addslashes($_POST['City']);
              @$Province = addslashes($_POST['Province']);
              @$PostCode = addslashes($_POST['Post Code']);
              @$TelHP = addslashes($_POST['Tel HP']);
              @$EMail = addslashes($_POST['E Mail']);
              @$Message = addslashes($_POST['Message']);
              // Validation
              if (strlen($Name) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($Street) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($City) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($Province) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($TelHP) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($EMail) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              if (strlen($Message) == 0 )
              {
              header("Location: error2.htm");
              exit;
              }
              //Sending Email to form owner
              $pfw_header = "From: $EMail\n"
              . "Reply-To: $EMail\n";
              $pfw_subject = "Contact Us";
              $pfw_email_to = "xxxx@xxx.kom";
              $pfw_message = "Name: $Name\n"
              . "Street: $Street\n"
              . "City: $City\n"
              . "Province: $Province\n"
              . "Post Code: $PostCode\n"
              . "Tel HP: $TelHP\n"
              . "Email: $EMail\n"
              . "Message: $Message\n";
              *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
              header("Location: confirmation2.htm");
              ?>
              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


              • #22
                Re: Form Script Assistance

                Originally posted by navaldesign View Post
                You have not checked correctly:

                the email field is "E Mail" in the form, "Email" in the script.
                The Telephone is "Tel HP" in the form, "TelHP" in the script.
                "Post Code": it exists in the form, but not in the script.

                ALL variables should be the same between form and script. Copy the script from here:


                <?php
                // Receiving variables
                @$Name = addslashes($_POST['Name']);
                @$Street = addslashes($_POST['Street']);
                @$City = addslashes($_POST['City']);
                @$Province = addslashes($_POST['Province']);
                @$PostCode = addslashes($_POST['Post Code']);
                @$TelHP = addslashes($_POST['Tel HP']);
                @$EMail = addslashes($_POST['E Mail']);
                @$Message = addslashes($_POST['Message']);
                // Validation
                if (strlen($Name) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($Street) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($City) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($Province) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($TelHP) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($EMail) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                if (strlen($Message) == 0 )
                {
                header("Location: error2.htm");
                exit;
                }
                //Sending Email to form owner
                $pfw_header = "From: $EMail\n"
                . "Reply-To: $EMail\n";
                $pfw_subject = "Contact Us";
                $pfw_email_to = "xxxx@xxx.kom";
                $pfw_message = "Name: $Name\n"
                . "Street: $Street\n"
                . "City: $City\n"
                . "Province: $Province\n"
                . "Post Code: $PostCode
                . "Tel HP: $TelHP\n"
                . "Email: $EMail\n"
                . "Message: $Message\n";
                *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
                header("Location: confirmation2.htm");
                ?>
                I copied your script above, but received report:
                Parse error: parse error in /home/httpd/vhosts/beruang.biz/httpdocs/contactus.php on line 57
                I tried to correct it but still not ok.
                . "Tel HP: $TelHP\n"
                (any different has space in between)
                I used EMail and TelHP in the form and also the script.

                Did I do any wrong again. Please help. Thank you.

                Comment


                • #23
                  Re: Form Script Assistance

                  Sorry, my mistake, i have edited it. Copy again the script and repeat the procedure.
                  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


                  • #24
                    Re: Form Script Assistance

                    Originally posted by navaldesign View Post
                    Sorry, my mistake, i have edited it. Copy again the script and repeat the procedure.
                    Hi! Naval,
                    I'm sorry to keep bothering you.
                    I have tried both scripts below ( One with blue text, was the first one, you provided. And the other with red text, was the one when I replied).
                    But both still go to error page even after all fields had been filled.
                    I rechecked and rechecked but still not good enough, could make it work/ go to confirmation2.
                    You said; you had edited it. Please advise again, which one you edited Blue or Red? Thank you.

                    <?php
                    // Receiving variables
                    @$Name = addslashes($_POST['Name']);
                    @$Street = addslashes($_POST['Street']);
                    @$City = addslashes($_POST['City']);
                    @$Province = addslashes($_POST['Province']);
                    @$PostCode = addslashes($_POST['Post Code']);
                    @$TelHP = addslashes($_POST['Tel HP']);
                    @$EMail = addslashes($_POST['E Mail']);
                    @$Message = addslashes($_POST['Message']);
                    // Validation
                    if (strlen($Name) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Street) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($City) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Province) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($TelHP) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($EMail) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Message) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    //Sending Email to form owner
                    $pfw_header = "From: $EMail\n"
                    . "Reply-To: $EMail\n";
                    $pfw_subject = "Contact Us";
                    $pfw_email_to = "
                    xxxx@xxx.kom";
                    $pfw_message = "Name: $Name\n"
                    . "Street: $Street\n"
                    . "City: $City\n"
                    . "Province: $Province\n"
                    . "Post Code: $PostCode\n"
                    . "Tel HP: $TelHP\n"
                    . "Email: $EMail\n"
                    . "Message: $Message\n";
                    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
                    header("Location: confirmation2.htm");
                    ?>


                    <?php
                    // Receiving variables
                    @$Name = addslashes($_POST['Name']);
                    @$Street = addslashes($_POST['Street']);
                    @$City = addslashes($_POST['City']);
                    @$Province = addslashes($_POST['Province']);
                    @$PostCode = addslashes($_POST['Post Code']);
                    @$TelHP = addslashes($_POST['Tel HP']);
                    @$EMail = addslashes($_POST['E Mail']);
                    @$Message = addslashes($_POST['Message']);
                    // Validation
                    if (strlen($Name) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Street) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($City) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Province) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($TelHP) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($EMail) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    if (strlen($Message) == 0 )
                    {
                    header("Location: error2.htm");
                    exit;
                    }
                    //Sending Email to form owner
                    $pfw_header = "From: $EMail\n"
                    . "Reply-To: $EMail\n";
                    $pfw_subject = "Contact Us";
                    $pfw_email_to = "
                    xxxx@xxx.kom";
                    $pfw_message = "Name: $Name\n"
                    . "Street: $Street\n"
                    . "City: $City\n"
                    . "Province: $Province\n"
                    . "Post Code: $PostCode
                    . "Tel HP: $TelHP\n"
                    . "Email: $EMail\n"
                    . "Message: $Message\n";
                    *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
                    header("Location: confirmation2.htm");
                    ?>

                    Comment


                    • #25
                      Re: Form Script Assistance

                      The blue one is the correct one.
                      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


                      • #26
                        Re: Form Script Assistance

                        Originally posted by navaldesign View Post
                        The blue one is the correct one.
                        <?php
                        // Receiving variables
                        @$Name = addslashes($_POST['Name']);
                        @$Street = addslashes($_POST['Street']);
                        @$City = addslashes($_POST['City']);
                        @$Province = addslashes($_POST['Province']);
                        @$PostCode = addslashes($_POST['Post Code']);
                        @$TelHP = addslashes($_POST['Tel HP']);
                        @$EMail = addslashes($_POST['E Mail']);
                        @$Message = addslashes($_POST['Message']);
                        // Validation
                        if (strlen($Name) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        if (strlen($Street) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        if (strlen($City) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        if (strlen($Province) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }

                        if (strlen($TelHP) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        if (strlen($EMail) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        if (strlen($Message) == 0 )
                        {
                        header("Location: error2.htm");
                        exit;
                        }
                        //Sending Email to form owner
                        $pfw_header = "From: $EMail\n"
                        . "Reply-To: $EMail\n";
                        $pfw_subject = "Contact Us";
                        $pfw_email_to = "xxxx@xxx.kom";
                        $pfw_message = "Name: $Name\n"
                        . "Street: $Street\n"
                        . "City: $City\n"
                        . "Province: $Province\n"
                        . "Post Code: $PostCode\n"
                        . "Tel HP: $TelHP\n"
                        . "Email: $EMail\n"
                        . "Message: $Message\n";
                        *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
                        header("Location: confirmation2.htm");
                        ?>


                        Yes, I got it . Thank you Naval,
                        I finally can get it to confirmation page.
                        I redo the form and go over scipt.

                        I couldn't get the Blue one work.
                        Please check green text.
                        Receiving variables and Sending e mail to form owner.
                        TelHP (no space )and Tel HP (space).
                        Tel HP (space) and TelHP (no space).
                        Email and EMail
                        Because of these irregular scripts causes the problem?
                        Please advise.

                        Comment


                        • #27
                          Re: Form Script Assistance

                          Don't confuse "Tel HP:" which is simply the text that you will recieve in the email, with the "$TelHP" which is the local variable assigned for the telephone, nor with the "($_POST['Tel HP']);" which is the post variable as recieved from the form. The script is correct, otherwise you would nor receive neither the email address or the telephone, and the script would go to the error 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

                          Working...
                          X