bubbadawg Posted July 9, 2006 Share Posted July 9, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/14071-saving-xml-to-server-~-sent-from-flash-to-php/ Share on other sites More sharing options...
willfitch Posted July 10, 2006 Share Posted July 10, 2006 Hey bubbadawg,You have magic_quotes_gpc turned on. Use stripslashes($_POST['xmlData']); and this should solve your issue. Quote Link to comment https://forums.phpfreaks.com/topic/14071-saving-xml-to-server-~-sent-from-flash-to-php/#findComment-55390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.