Trying to capture form info on database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #16
    Re: Trying to capture form info on database

    DEPENDS ENTIRELY ON YOU. i SUGGEST:


    Title 4 (BASED ON WHAT YOU HAVE NOW IN YOUR FORM)
    First name 20
    Surname 30
    Tel number 16
    Email 30
    Subject 25
    Message 255 (MAX)
    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

    • Rob
      Second Lieutenant

      • Oct 2005
      • 126

      #17
      Re: Trying to capture form info on database

      Hi Naveldesign,

      Sorry I was away for a couple of days so am now back.

      Have filled in fields with numbers as suggested and been through the rest of the changes and uploaded.

      The name of the database on the CP was "jioioipz_saul" so I changed it where is said "saul_contact_form" on the script.

      Have just done a test on the form as I thought all finished and I got the error message:

      Parse error: parse error, unexpected ',' in /home/jioioipz/public_html/contact.php on line 30



      please can you advise. I feel we are nearly there.

      Many thanks,

      Rob

      www.saulfarm.com
      www.saulfarm.com
      www.pumfrett.com
      www.dampguard.com
      www.zakoapartments.com

      Comment

      • Rob
        Second Lieutenant

        • Oct 2005
        • 126

        #18
        Re: Trying to capture form info on database

        Hi,

        Have just published up the script again and got the same message only ending with " line 39"

        On the script where it says "suname" several time throughout should that be "surname"

        thanks,

        Rob

        www.saulfarm.com
        www.saulfarm.com
        www.pumfrett.com
        www.dampguard.com
        www.zakoapartments.com

        Comment

        • Rob
          Second Lieutenant

          • Oct 2005
          • 126

          #19
          Re: Trying to capture form info on database

          If it helps at all the script you suggested is now:

          <?php
          // Receiving variables
          @$Title = addslashes($_POST['Title']);
          @$First_Name = addslashes($_POST['First_Name']);
          @$Suname = addslashes($_POST['Suname']);
          @$Tel_No = addslashes($_POST['Tel_No']);
          @$Email = addslashes($_POST['Email']);
          @$Subject = addslashes($_POST['Subject']);
          @$Message = addslashes($_POST['Message']);
          //Sending Email to form owner
          $pfw_header = "From: $Email\n"
          . "Reply-To: $Email\n";
          $pfw_subject = "Saul contact form";
          $pfw_email_to = "rob@saulfarm.com ";
          $pfw_message = "Info Submitted from Contact Webform\n"
          . "----------------------------------------------\n"
          . "\n"
          . "Title: $Title\n"
          . "First_Name: $First_Name\n"
          . "Suname: $Suname\n"
          . "Tel_No: $Tel_No\n"
          . "Email: $Email\n"
          . "Subject: $Subject\n"
          . "Message: $Message\n";
          *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
          //saving record to MySQL database
          @$pfw_strQuery = "INSERT INTO `saul`(`Title`,`Firstname`,`Surname`,`Telnumber`,` Email`,`Subject`,`Message`)VALUES (\"$Title\",\"$First_Name\",\"$Suname\",\"$Tel_N o\ ",\"$Email\",\"$Subject\",\"$Message\")" ;
          @$pfw_host = "localhost";
          @$pfw_user = "richard";
          @$pfw_pw = "bookers";
          @$pfw_db = "jioioipz_saul";
          $pfw_link = mysql_connect($pfw_host, $pfw_user, $pfw_pw);
          if (!$pfw_link) {
          die('Could not connect: ' . mysql_error());
          }
          $pfw_db_selected = mysql_select_db($pfw_db, $pfw_link);
          if (!$pfw_db_selected) {
          die ('Can not use $pfw_db : ' . mysql_error());
          }
          //insert new record
          $pfw_result = mysql_query($pfw_strQuery);
          if (!$pfw_result) {
          die('Invalid query: ' . mysql_error());
          }
          mysql_close($pfw_link);
          header("Location: thankyou_page.html");
          ?>

          This may give a clue regarding the error message and why its not working,

          Regards,

          Rob
          www.saulfarm.com
          www.pumfrett.com
          www.dampguard.com
          www.zakoapartments.com

          Comment

          • Rob
            Second Lieutenant

            • Oct 2005
            • 126

            #20
            Re: Trying to capture form info on database

            Hi Naveldesign,

            I've changed the form back temporarily as we are missing enquiries leaving it not working. I took your advise and have changed the "e" to an "E" on Email script and it is bringing people's mails in on their name rather than from the form as unspecified.

            If you can see what I'm doing wrong with the database I'd be really grateful to sort it out as we can then apply the same principles to other sites we have started work on.

            Regards,

            Rob.


            www.saulfarm.com
            www.saulfarm.com
            www.pumfrett.com
            www.dampguard.com
            www.zakoapartments.com

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #21
              Re: Trying to capture form info on database

              Please try again with this. If it still gets an error post back.

              <?php
              // Receiving variables
              @$Title = addslashes($_POST['Title']);
              @$First_Name = addslashes($_POST['First_Name']);
              @$Suname = addslashes($_POST['Suname']);
              @$Tel_No = addslashes($_POST['Tel_No']);
              @$Email = addslashes($_POST['Email']);
              @$Subject = addslashes($_POST['Subject']);
              @$Message = addslashes($_POST['Message']);
              //Sending Email to form owner
              $pfw_header = "From: $Email\n"
              . "Reply-To: $Email\n";
              $pfw_subject = "Saul contact form";
              $pfw_email_to = "rob@saulfarm.com ";
              $pfw_message = "Info Submitted from Contact Webform\n"
              . "----------------------------------------------\n"
              . "\n"
              . "Title: $Title\n"
              . "First_Name: $First_Name\n"
              . "Suname: $Suname\n"
              . "Tel_No: $Tel_No\n"
              . "Email: $Email\n"
              . "Subject: $Subject\n"
              . "Message: $Message\n";
              *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
              //saving record to MySQL database
              @$pfw_strQuery = "INSERT INTO `saul`(`Title`,`Firstname`,`Surname`,`Telnumber`,` Email`,`Subject`,`Message`)VALUES (\"$Title\",\"$First_Name\",\"$Suname\",\"$Tel_N o\ ",\"$Email\",\"$Subject\",\"$Message\")" ;
              @$pfw_host = "localhost";
              @$pfw_user = "richard";
              @$pfw_pw = "bookers";
              @$pfw_db = "jioioipz_saul";
              $pfw_link = mysql_connect($pfw_host, $pfw_user, $pfw_pw);
              if (!$pfw_link)
              {
              die('Could not connect: ' . mysql_error());
              }
              $pfw_db_selected = mysql_select_db($pfw_db, $pfw_link);
              if (!$pfw_db_selected)
              {
              die ('Can not use $pfw_db : ' . mysql_error());
              }
              //insert new record
              $pfw_result = mysql_query($pfw_strQuery);
              if (!$pfw_result)
              {
              die('Invalid query: ' . mysql_error());
              }
              mysql_close($pfw_link);
              header("Location: thankyou_page.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

              • Rob
                Second Lieutenant

                • Oct 2005
                • 126

                #22
                Re: Trying to capture form info on database

                Hi Naveldesign,

                Afraid still gets error, only this time is as follows:

                Parse error: parse error, unexpected ',' in /home/jioioipz/public_html/contact.php on line 36

                regards,

                Rob
                www.saulfarm.com
                www.pumfrett.com
                www.dampguard.com
                www.zakoapartments.com

                Comment

                Working...
                X