Hi,
I have the following code:
while( list($k,$v) = each($HTTP_POST_VARS) ) {
$k1 = strtoupper ( $k );
$v1 = strtoupper ( $v );
$n = "$k1=$v1";
$data = eregi_replace ( "_", " ", $n );
}
The $HTTP_POST_VAR is a piece of XML sent from flash. When flash sends the XML it has no name so PHP tries to give it a name ($k) by taking the node name and the first attribute and turning into $k. The rest of the XML is turned into the value. This explains why I have used
$n = "$k1=$v1";
as it sorts out the XML back into its original format. So the variable $data contaons a string of XML which looks like this
$data = "<item name="blah" date="blah">";
I can then write this data to a text file using
$filename = "test.txt";
$fd = fopen($filename, "a+");
fputs($fd, $data);
fclose($fd);
So this way I can see that $data exists in the format I would expect.
However when I try to pass $data into an XML parsing function - nothing happens.
I know the XML parser works because if I explicitly declare $data to equal the xml (i.e. not getting it from the $HTTP_POST_VARS it parses it fine)
I do not understand this. Can someone please help me.
TIA
john