Re: [PHP] Problem receiving POSTed data



Problem solved: it was indeed that the flash object did not like
multidimensional data.

I didn't change my PHP code one little bit. But I changed my my
ActionScript code to write the data in a 1-dimensional form as follows:

/*****************************************/
for(var i in _level0) {
if(typeof(_level0[i]) == "movieclip") {
data_lv[i + "_path"] = _level0[i];
data_lv[i + "_id"] = _level0[i]._name;
data_lv[i + "_x"] = _level0[i]._x;
data_lv[i + "_y"] = _level0[i]._y;
}
}
data_lv.sendAndLoad("myScript.php", data_lv, "POST");

/******************************************/


This works perfectly and php receives all of the data correctly. Thanks
guys for your thoughts. I'm going to be posting an addition to the online
ActionScript documentation to hopefully help others avoid this pitfall!

Andy

On 10/6/06, Andy Hultgren <wearhdphp@xxxxxxxxx> wrote:

Am working on #2 right now...

On 10/6/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
>
> On Fri, October 6, 2006 4:01 pm, Andy Hultgren wrote:
> > /*************************************/
> > $data = $_POST;
> > $stuff = "\n \n Post contains:";
> >
> > foreach($data as $prop => $val) {
> > $stuff .= "\n {$prop}: {$val}";
> > }
> > /*************************************/
>
> <pre><?php var_dump($_POST);?></pre>
>
> PHP does pretty minimal munging of the POST data.
>
> It's unlikely that Flash is sending what you think it's sending.
>
> Even if it is, you have two options:
>
> 1. Use HTTP_RAW_POST_DATA (turn it on in PHP) and write your own Flash
> array parser in PHP.
>
> 2. Convince Flash to POST data more like PHP wants it:
> id[a][prop1]=a1&id[a][prop2]=a2&id[b][prop1]=b1...
>
> #2 will probably be WAY easier, unless Flash is even more broken than
> I think. And I think Flash is pretty broken. :-)
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>



Relevant Pages

  • RE: [PHP] how to create a slide show using PHP5
    ... For ready solutions like this you won't need a flash editor. ... [PHP] how to create a slide show using PHP5 ... I want to create a slide show of photos for my web site. ... Web Photo Gallery Software, *PHP* Photo Gallery Script, Web Site ...
    (php.general)
  • sending flash variable to php file
    ... php, but I can't get the flash to transfer the variable. ... // check for an empty string and display a message. ... // $pages now contains int of pages needed unless there is a remainder from ...
    (alt.php)
  • Re: [PHP-DEV] Sayonara PHP
    ... a market in which there are lots of opportunities in many different ... I think it depends on how you use PHP to be honest. ... technology and Flash for client technology. ... building a thick client on HTML DOM and javascript is a good idea. ...
    (php.general)
  • Re: Flash & PHP Session
    ... I have an upload application written in PHP and Flash. ... the php page cannot access the $_SESSION. ... append this to every GET request to php. ...
    (comp.lang.php)
  • Re: Flash & PHP Session
    ... I have an upload application written in PHP and Flash. ... the php page cannot access the $_SESSION. ... you append this to every GET request to php. ...
    (comp.lang.php)