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

entry point within code to trigger a xml generation script


  1. radixbv
    Member

    Can you provide a pointer to the code where we could insert a xml generation script

    A customer of us uses a lot of forms.
    In the past the made there own php script to process all the forms.
    As forms getting more and more complicated, if recommended to have a look at machform.

    The only obstacle is that the now generate as email with a xml output of the form data as a attachment.
    That can be processed by the application that they use.

    An mysql script that generate a xml file for a certain entry is easy.

    S i was thinking to add this to the code at a certain point: Just before the email is generated. Also a point where there is access tot the record fields.

    Can you give me a pointer.

    Posted 11 years ago #
  2. yuniar

    It should be inside "includes/helper-functions.php" file. Around line 240, you'll find a function with the name "mf_send_notification".
    You can put your code into that function.

    All the data is already available within $entry_details array. So you can simply loop through that to get the data.


    MachForm Founder

    Posted 11 years ago #
  3. RonSwanson
    Member

    Apologies for resurrecting an old thread, but I searched everywhere for a few days without much luck!

    I'm trying to do something similar - write an xml file and store it locally on the server.

    I can't work out how to access the fields contained in $entry_details...

    For example, I created a basic form with a single text field entry ('element_1' in the SQL database entry). I want to write the string value to my xml file, so in mf_send_notification(), after the call to mf_get_entry_details(), I am doing the following:

    $xml_filename = utf8_encode("XMLFile_{$entry_id}");
    $file = fopen($xml_filename,"w");
    echo fwrite($file,"TEST");
    echo fwrite($file,"{$entry_details['element_1']}");

    But the output file only contains "TEST"?

    Sorry, my php/sql skills are pretty limited... Any help would be much appreciated, thanks!

    Posted 9 years ago #

RSS feed for this topic

Reply