This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Post form result


  1. alecd4
    Member

    Love the product!
    Email form submission doesn't work for us. We would like to be able to post form content after the form is submitted locally to a website via a https post. Any suggestions are appreciated.

    Posted 12 years ago #
  2. alecd4
    Member

    Here is what I did so far: I found the following function in post-functions.php - mf_commit_form_review()

    line 2351: $new_record_id = (int) $dbh->lastInsertId();

    It looks to me that after this line I have all final data in form_{$form_id) So I can get the data using $new_record_id as a key. So I inserted

    //GETS NEWLY CREATED RECORD
         $query = "SELECT {$columns_joined} FROM <code>&quot;.MF_TABLE_PREFIX.&quot;form_{$form_id}</code> WHERE id=?";
         $params = array($new_record_id);
         $sth = mf_do_query($query,$params,$dbh);
         $data = mf_do_fetch_result($sth);
         //add guid
         $guid=$_SESSION['yapi']['guid'];
         $data = $data + array('guid' => $guid);
         $json=json_encode($data);

    $_SESSION['yapi']['guid'];above is set previously in view.php from $_GET parameter. Finally, $json string is posted to a remote server.

    Am I missing something?

    Posted 12 years ago #
  3. yuniar

    I assume you have form review enabled? If so, the code you posted above is pretty much correct.
    However, you need to place the code much further to the bottom.

    On line 2444:

    $_SESSION['mf_form_completed'][$form_id] = true;

    put your code below that line.


    MachForm Founder

    Posted 12 years ago #
  4. alecd4
    Member

    Thank you

    Posted 12 years ago #
  5. Amarok
    Member

    I try to implement the tip proposed here by alecd4 - but I'm unable to make it work !
    I suspect he wrote that for a previous machform version ... Am I right ?

    Anyone have another solution for the current machform version (4.2) ?
    Thank you in advance for your help.

    Posted 10 years ago #
  6. williamansley
    Member

    @Amarok: It is certain that alecd4 was referring to a previous version of Machform, since the message was posted two years ago. If I am understanding the previous messages, then what you want to do can be done by the use of the new webhooks feature in Machform 4.2 without the need for any custom coding. I can't offer you any help with this, but take a look at the announcement linked to below for more information:

    http://www.appnitro.com/blog-webhook-api-integration

    Posted 10 years ago #
  7. Amarok
    Member

    @ williamansley: Thank you very much for your reply. I plan to try the webhook solution.

    Posted 10 years ago #

RSS feed for this topic

Reply