Jump to content

Archived

This topic is now archived and is closed to further replies.

bubbadawg

Saving XML to server ~ sent from Flash to PHP

Recommended Posts

Hello All ----

I am relatively new to PHP and need some minor assistance. I am passing from Flash to PHP an XML object which I only need PHP to save on the server. The XML file that is being saved is close to correct but has some extraneous characters inserted (" \ "). I am guessing I need to escape or parse them, but not really sure. Here is my PHP code:

[code]
<?php
    $filename = "images.xml";
    $receivedData = $_POST['xmlData'];

    $fp = fopen($filename, "w");
    fwrite($fp, $receivedData);
    fclose($fp);
?>
[/code]

Here is the a sample of the XML that is saved on the server:

[code]
<images>
<album description=\"Description of New Album\" title=\"New Album\" lgPath=\"/\" tnPath=\"gallery//\" tn=\"gallery/sample_tn.jpg\">
<img title=\"Title Here\" imgName=\"sample.jpg\" />
</album>
</images>
[/code]

Any help is greatly appreciated. Thanks for any and all replies.

Share this post


Link to post
Share on other sites
Hey bubbadawg,

You have magic_quotes_gpc turned on.  Use stripslashes($_POST['xmlData']); and this should solve your issue.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.