Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-27-2003, 11:05 AM   #1
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Talking Flash, XML, Php & escape characters

I'm loading an XML file in Flash, I modify it and then I send it to a php script that writes it in the same XML file.
The problem is that Flash writes the "\" character before every ' " '. And the file becomes invalid (cannot be shown in browser).
Is there a way to tell flash not to use the eschape character and annoy me?
Here's the php code, if needed:
PHP Code:
<?php
         $mesaj
="";
         
$mesaj .= $myxml;
           
//myxml is a string variable that's been sent from flash 
              
$f fopen("file.xml""w");
         
fputs($f$mesaj);
         
fclose($f);
?>
AngelEyesShadow is offline   Reply With Quote
Old 11-27-2003, 11:08 AM   #2
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Question

There's no problem when I don't have any attributes and no references at the beginning of the xml file, such as: <?xml version="1.0"?>...
AngelEyesShadow is offline   Reply With Quote
Old 11-28-2003, 05:39 AM   #3
buggedcom
CONTEMPLATING LIFE
 
Join Date: Sep 2001
Location: i'm feeling slightly teddy-ish
Posts: 733
Send a message via AIM to buggedcom
Default

the reason is quite simple. When you send any strings via post (or get i think) flash sends the string to the server but automatically urlencodes and unescapes the string. so do correct it all you need to do is modify your php slightly

PHP Code:
<?php
    $mesaj 
str_replace("\\\", "", "$myxml");
    
$f = fopen("file.xml", "w");
    fputs(
$f$mesaj);
    fclose(
$f);
?>
__________________
~bugged
I am looking for freelance work

imageWeaver gallery
microsite direct download

play here microgame (unfinshed, also give it a while to load)
game

Last edited by buggedcom; 11-28-2003 at 05:42 AM.
buggedcom is offline   Reply With Quote
Old 12-01-2003, 07:38 AM   #4
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Default

Thanx man....
I haven't thought of that...
It works just fine now...
Thanx
AngelEyesShadow is offline   Reply With Quote
Old 12-01-2003, 07:40 AM   #5
buggedcom
CONTEMPLATING LIFE
 
Join Date: Sep 2001
Location: i'm feeling slightly teddy-ish
Posts: 733
Send a message via AIM to buggedcom
Default

no probs
buggedcom is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:48 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.