piping php-generated xml to flash

piping php-generated xml to flash

am 17.12.2005 13:17:47 von henri

Hello,

I'm building a photo gallery using flash as a front-end to a mysql
database. I use php to query the database.
I was wondering if it was possible to generate xml into a stream that
would be directly piped to flash.
See, normally one would use php to write an xml file that would then be
read by flash eg.

xmlData = new XML();
xmlData.load("query_results.xml")

what I want is this: xmlData.load("query.php") where query.php would be
something like


echo ""
echo "";
echo "";
echo "
echo "
echo "

echo "


?>

Henri

--

The Dude once said,
"Yeah, well, you know, that's just, like, your opinion, man."

Re: piping php-generated xml to flash

am 18.12.2005 02:50:59 von Nicholas Sherlock

Henri wrote:
> what I want is this: xmlData.load("query.php") where query.php would be
> something like
>
> >
> echo ""
> echo "";
> echo "";
> echo "
> echo "
> echo "

> echo "

>
> ?>

Yes? That sounds fine, what problems are you having with it? You may
need to call:

Header('Content-type: text/xml');

before you start echo'ing.

Cheers,
Nicholas Sherlock

Re: piping php-generated xml to flash

am 19.12.2005 00:09:22 von nc

Henri wrote:
>
> I'm building a photo gallery using flash as a front-end to
> a mysql database. I use php to query the database.
> I was wondering if it was possible to generate xml into
> a stream that would be directly piped to flash.

Sounds doable...

> See, normally one would use php to write an xml file that
> would then be read by flash eg.
>
> xmlData = new XML();
> xmlData.load("query_results.xml")
>
> what I want is this: xmlData.load("query.php") where
> query.php would be something like
>
> echo ""
> echo "";
> echo "";
> echo "
> echo "
> echo "

> echo "


You might consider two things:

1. Add header('Content-type: text/xml') at the beginning
of your script.

2. Consider xmlData.load("http://localhost/query.php");
otherwise, PHP interpreter may not be called and Flash
will access the PHP source code, not the XML the
script is supposed to generate.

Cheers,
NC

Re: piping php-generated xml to flash

am 19.12.2005 14:49:22 von henri

Nicholas Sherlock wrote:
> Henri wrote:
>
>> what I want is this: xmlData.load("query.php") where query.php would
>> be something like
>>
>> >>
>> echo ""
>> echo "";
>> echo "";
>> echo "
>> echo "
>> echo "

>> echo "

>>
>> ?>
>
>
> Yes? That sounds fine, what problems are you having with it? You may
> need to call:
>
> Header('Content-type: text/xml');
>
> before you start echo'ing.
>
> Cheers,
> Nicholas Sherlock

Thanks Nicholas.

In fact, I somehow knew it was possible just after hitting the sent
button. "voicing" the question gave me the answer. I've tried it and
after several attempts managed to get it to work. oh, and you don't need
the Header('Content-type: text/xml') thing, or ,at least, it works well
without it.

This flash:php:mysql:xml stuff is quite exciting!

--

The Dude once said,
"Yeah, well, you know, that's just, like, your opinion, man."

Re: piping php-generated xml to flash

am 19.12.2005 14:53:01 von henri

NC wrote:
> Henri wrote:
>
>>I'm building a photo gallery using flash as a front-end to
>>a mysql database. I use php to query the database.
>>I was wondering if it was possible to generate xml into
>>a stream that would be directly piped to flash.
>
>
> Sounds doable...
>
>
>>See, normally one would use php to write an xml file that
>>would then be read by flash eg.
>>
>>xmlData = new XML();
>>xmlData.load("query_results.xml")
>>
>>what I want is this: xmlData.load("query.php") where
>>query.php would be something like
>>
>>echo ""
>>echo "";
>>echo "";
>>echo "
>>echo "
>>echo "

>>echo "

>
>
> You might consider two things:
>
> 1. Add header('Content-type: text/xml') at the beginning
> of your script.
>
> 2. Consider xmlData.load("http://localhost/query.php");
> otherwise, PHP interpreter may not be called and Flash
> will access the PHP source code, not the XML the
> script is supposed to generate.
>
> Cheers,
> NC
>

Thanks

--

The Dude once said,
"Yeah, well, you know, that's just, like, your opinion, man."

Re: piping php-generated xml to flash

am 19.12.2005 19:46:38 von henri

Henri wrote:
> Nicholas Sherlock wrote:
>
>> Henri wrote:
>>
>>> what I want is this: xmlData.load("query.php") where query.php would
>>> be something like
>>>
>>> >>>
>>> echo ""
>>> echo "";
>>> echo "";
>>> echo "
>>> echo "
>>> echo "

>>> echo "

>>>
>>> ?>
>>
>>
>>
>> Yes? That sounds fine, what problems are you having with it? You may
>> need to call:
>>
>> Header('Content-type: text/xml');
>>
>> before you start echo'ing.
>>
>> Cheers,
>> Nicholas Sherlock
>
>
> Thanks Nicholas.
>
> In fact, I somehow knew it was possible just after hitting the sent
> button. "voicing" the question gave me the answer. I've tried it and
> after several attempts managed to get it to work. oh, and you don't need
> the Header('Content-type: text/xml') thing, or ,at least, it works well
> without it.

I correct that: Header('Content-type: text/xml') is needed.

>
> This flash:php:mysql:xml stuff is quite exciting!
>


--

The Dude once said,
"Yeah, well, you know, that's just, like, your opinion, man."