![]() |
Return XML From Function
I'm working with a flash developer and using AMFPHP on the back end .
I've got a class with a function that creates a thumbnail. I am needing to return a very simple xml string: Quote:
Can anyone point me in the right direction. |
Having difficulties generating it or parsing it?
|
generating
|
in what way are you having hard time with? i.e. you dont have a clue how to start or are you getting an almighty error?
|
i'll just assume that you dont know how to do it, PHP DOM to the rescue....again.
ach! if i have to code one more php DOM script today i think i may go completely mad ,actually thats a lie, as its already happend EHHHEHEHHHHAHAHAHAHAAH *clears throat* anyway back to php for a moment if we may (how ever funny insanity may be) PHP Code:
xml Code:
PHP Code:
Im off to continue my insanity now gooooooooooooooobyyyyyyyyyyyeeeeee |
Going on your code sample, could you not just do something like:
PHP Code:
Alan |
he could, but where would the fun be i ask you???????
|
yea, alan's example is better suited to your needs atm, but if you needed multiple 'imageCacheResults' PHP DOM is the way to go, it will get messy pratting around with strings and loops and god knows what, although you would have to create a new root, i.e.:
xml Code:
bah humbug im going to bed, im far to tired my brain is farting out errors again |
Hey Guys,
Sorry for not being so clear - I couldn't figure out what in the world was going on but after fooling with it I was able to pinpoint what is happening. I've got a thumbnail creation script that fires off prior to the xml output so I'm having to set a content type header twice - and it's not working the second time. Is there any way to avoid this conflict? Thanks jw |
Yeah, save the image to a file! You cannot output two separate content types within the same request. So, cache the thumbnail and link to that in your thumbnail parameter. Else, you'll have to turn on the override switch (header).
|
| All times are GMT. The time now is 01:54 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0