The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/showthread.php 137 forum_permissions
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Trying to access array offset on value of type null - Line: 488 - File: inc/db_mysqli.php PHP 8.1.27 (Linux)
File Line Function
/inc/db_mysqli.php 488 errorHandler->error
/showthread.php 722 DB_MySQLi->fetch_field
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(871) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(871) : eval()'d code 11 errorHandler->error
/inc/functions_post.php 871 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.27 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send data to form tools after successfully sending to SOAP webservice
#1
Question 
Hi Ben,

Love the new formtools. I have been using the first form tools for over a year and now I am just starting to use FT 2.0 on a new project.

A client of mine is sending form data via a SOAP webservice. The webservice validates all the data and is sent to a networks database. My client also wants the form data to be sent to a database on their website.

I thought this would be an excellent time to use form tools again.

However, i'm having a problem sending the data.

Basically, on my form page I have this code, which comes into play after a user submits the form:

Code:
<?php if ($result[[Message] == "OK" ) { ?>

THANK YOU TEXT

<?php  } else { ?>

ERROR TEXT

<?php } ?>

So if the the form that has been submitted gets the ok from the SOAP webservice the user receives the "Thank you text".

It's at this point I want the data to be sent to form tools. I have the form data in variables, they are also in the $_POST['field'] variables.

Im having a problem because I don't need to use the "submit_button" or "next_page" variables, etc. I don't need form tools to redirect to a thank you page or anything like that.

Is it possible to simply send the data to form tools as it is in the background, if it has been successfully received by the SOAP webservice?

So something like:

Code:
<?php if ($result[[Message] == "OK" ) { ?>

ft_api_process_form();

THANK YOU TEXT

<?php  } else { ?>


Thank you for any help in advance! :-)
Reply
#2
Hmm, I'm having real problems trying to do this. I can get the forms in the database by using this code:

Code:
<?php if ($result[[Message] == "OK" ) {

require_once("leads/global/api/api.php");
$fields = ft_api_init_form_page(2, "initialize");
$params = array(
  "submit_button" => "submit",
  //"next_page" => "thanks.php",
  "form_data" => $_POST,
  //"file_data" => $_FILES,
  "finalize" => true
    );

ft_api_process_form($params);

?>

THANK YOU TEXT

<?php  } else { ?>

But that gets a lot of errors referring to headers already being sent, as this code really needs to be at the top of the page.

But when I do that it interferes with the methods im calling for the SOAP function.

So if I could add some code in the same area as I tried above, then this would be ideal. I just need to get that data into the formtools database. Is there any manual code I could use?

If anyone can help I would really appreciate it.

Cheers :-P
Reply
#3
OK, excellent looks like I have found away around this using Curl.

Instead of going through the form tools API, im using the process.php method and automatically sending the form, after a success message from the SOAP webservice, via Curl.

Here is the Curl code:

Code:
<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/path/to/formtools/process.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);

$data = array(
    'foo' => 'foo foo foo',
    'bar' => 'bar bar bar',
    'baz' => 'baz baz baz'
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

?>

All the fields are in the $data array and this is where you would also put the hidden formtools fields, such as the initiate form and the form ID field.

It would have been nice to use the formtools API, but I guess this works as all I needed was to get the data into formtools somehow.

Anyone have any opinions about this method, is it good or would you recommend another approach?

Happy new year!
Reply
#4
Very interesting! That's actually not a bad approach at all - but I do agree, the API should contain an option to do it automatically.

I have no objections to your approach, though.

- Ben
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)