grover970
08-14-2011, 09:32 PM
I need to create a script that will write an XML document from a HTTP.POST.
Ive read a number of threads learning how to write the XML file. I'm just not sure how I would parse the POST and then to write the file on the server.
Any help is much appreciated.
The typical POST will look like this:
01Array (
02 [variables] => Array (
03 [response_id] => 123456
04 [survey_id] => 100001
05 [survey_title] => Cool survey with all question types
06 [total_responses] => 23
07 [start_date] => 2010-02-15 16:27:00
08 [end_date] => 2010-02-15 17:33:17
09 [ip_address] => 98.16.84.122
10 [country] => Ireland
11 [custom_tags] => Array (
12 [0] => Array (
13 [name] => customer_reference
14 [value] => RT123456
15 ) )
16 [answers_xml] =>
17 <answers>
18 <question number="1">
19 <title>Text Single question type</title>
20 <answer>Some test single text</answer>
21 </question>
22 <question number="2">
23 <title>Text Paragraph question type</title>
24 <answer>Some test paragraph text</answer>
25 </question>
26 <question number="3">
27 <title>Email question type</title>
28 <answer>no-reply@gmail.com</answer>
29 </question>
30</answers>
31 ) )
Ive read a number of threads learning how to write the XML file. I'm just not sure how I would parse the POST and then to write the file on the server.
Any help is much appreciated.
The typical POST will look like this:
01Array (
02 [variables] => Array (
03 [response_id] => 123456
04 [survey_id] => 100001
05 [survey_title] => Cool survey with all question types
06 [total_responses] => 23
07 [start_date] => 2010-02-15 16:27:00
08 [end_date] => 2010-02-15 17:33:17
09 [ip_address] => 98.16.84.122
10 [country] => Ireland
11 [custom_tags] => Array (
12 [0] => Array (
13 [name] => customer_reference
14 [value] => RT123456
15 ) )
16 [answers_xml] =>
17 <answers>
18 <question number="1">
19 <title>Text Single question type</title>
20 <answer>Some test single text</answer>
21 </question>
22 <question number="2">
23 <title>Text Paragraph question type</title>
24 <answer>Some test paragraph text</answer>
25 </question>
26 <question number="3">
27 <title>Email question type</title>
28 <answer>no-reply@gmail.com</answer>
29 </question>
30</answers>
31 ) )