Hi,
We are getting information from another company that will be collecting the information and posting it to us through a url probably with asp or asp.net if that makes a diffrence.
So what I am wanting to do is set up the php code for the url to process the information sent over.
I can read and parse xml information from a local file with this code
<?php
$compiled_langs = array();
$interprt_langs = array();
$flag = "";
$count = 0;
function opening_element($parser, $element, $attributes) {
/ opening XML element callback function /
global $flag;
if ($element == "languages")
$flag = $attributes["type"];
}
function closing_element($parser, $element) {
/ closing XML element callback function /
global $flag;
if ($element == "languages")
$flag = "";
}
function character_data($parser, $data) {
/ callback function for character data /
global $flag;
if ($flag == "compiled") {
global $compiled_langs;
$compiled_langs[] = $data;
}
if ($flag == "interpreted") {
global $interprt_langs;
$interprt_langs[] = $data;
}
}
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($parser, "opening_element", "closing_element");
xml_set_character_data_handler($parser, "character_data");
$document = file("sample.xml");
foreach ($document as $line) {
xml_parse($parser, $line);
}
xml_parser_free($parser);
echo "The following compiled languages were found...<br />";
foreach ($compiled_langs as $name) {
$count++;
echo "$count. $name <br />";
}
echo "<br />";
$count = 0;
echo "The following interpreted languages were found...<br />";
foreach ($interprt_langs as $name) {
$count++;
echo "$count. $name <br />";
}
?>
I found the variable $HTTP_RAW_POST_DATA that looks like it might do it but was wondering if any one had any experience with this.
The recieved information will be put in a database not out to the screen like the code above, but that part is trivial I just need to find out how to get the info from the url.
the xml doc will look like this
<Order>
<OrderID></OrderID>
<OrderDateTime></OrderDateTime>
<Debtor Salutation="" FirstName="" MiddleName="" LastName="" Suffix=""></Debtor>
<CoDebtor Salutation="" FirstName="" MiddleName="" LastName="" Suffix="" ></CoDebtor>
<Address Street1="" City="" State="" ZipCode=""/>
<HomePhone AreaCode="" Exchange="" Number=""/>
<WorkPhone AreaCode="" Exchange="" Number="" Extension=""/>
<CellPhone AreaCode="" Exchange="" Number=""/>
<Email Address=""/>
</Order>