PDA

View Full Version : loading variables which contain '&' character..how?


swisslyons
01-17-2003, 09:47 PM
I am loading in an array or urls from my database via php into my flash movie.

the output of my script looks like this:

&id=1,&imagelist=1.jpg,&urls=http://www.homemade.ch/shop/100/conliste.asp?langext=&katno=8|&titles=Silence|&comments=Silence, a painting by Bea Fehr|

problem is that the url contains the '&' character, which Flash uses to seperate the variables....

ex:

http://www.homemade.ch/shop/100/conliste.asp?langext=&katno=8

but problem is that it is being read into flash as this:
http://www.homemade.ch/shop/100/con_liste.asp?langext=

becuase Flash cuts it off when he see the '&' sign.

How can I workaround this problem, has to be a common issue I would guess since lots of URLs have this format....?

Do I need to write some parsing code?

jimburton
01-18-2003, 12:27 AM
use urlencode($stringVar) to encode it in php, then when you get into flash you'll have to replace %20's etc with what they originally were...
but this will all be a bit of a headache and you seem to have structured data to transfer, so use xml - that's the way to do it, cos then you can use cdata sections with any old characters inside, and you don't have to do fancy string handling at the flash end to put this back into the strcuture you need.