FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hooks manager for sending info to another database
#1
I'm trying to setup hooks manager to send the data submitted to another database. I want this to grab the values entered and send them all to another database when the form is submitted. Below is the code and I have it set for the
Code:
ft_finalize_form, end
hook with a rule priority at 1:



if ($_POST["timer_container"0)
{
  // Server Vars
  $servername "***.***.***";
  $username "********";
  $password "********";
  $dbname "********";

  // Form Variables
  $TypeVal $_POST["TypeVal"];
  $moldID $_POST["moldID"];
  $last_modified_date $time_stamp;
  $timer_container $_POST["timer_container"];
  $q1 $_POST["q1"];
  $q2 $_POST["q2"];
  $q3 $_POST["q3"];
  $q4 $_POST["q4"];
  $q5 $_POST["q5"];
  $q6 $_POST["q6"];
  $q7 $_POST["q7"];
  $q8 $_POST["q8"];
  $q9 $_POST["q9"];
  $q10 $_POST["q10"];
  $q11 $_POST["q11"];
  $q12 $_POST["q12"];
  $q13 $_POST["q13"];
  $notes $_POST["notes"];
  $employeeID $_POST["employeeID"];
  $machine $_POST["machine"];

  // Create connection
  $conn new mysqli($servername$username$password$dbname);
  // Check connection
  if ($conn->connect_error{
      die("Connection failed: " $conn->connect_error);
  

  $sql "INSERT INTO moldpm (TypeVal, Machine, Time_Stamp, Elapsed, 
          Q01Q02Q03Q04Q05Q06Q07Q08Q09Q10Q11Q12Q13Q14Q15
          NotesEmployeePress
          VALUES($scada_pdo$scada_sql$TypeVal$moldID$last_modified_date$timer_container$q1$q2$q3$q4$q5$q6$q7$q8$q9$q10$q11$q12$q1355$notes$employeeID$machine)";

  if ($conn->query($sql=== TRUE{
      echo "New record created successfully";
  else {
      echo "Error: " $sql "<br>" $conn->error;
  }

  $conn->close();
}


Can anyone help me out? Not sure if I'm fully understanding the hooks manager.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)