Hi Karl,

The Flash part is no problem.
But in PHP I am a novice!

So far I learned that I should think of sending Strings to PHP instead of a
complete multi-dim array.
I don't know how to set up PHP to open it once. Do all your sending and
inserting, then close once I am done?
Do you have some examples of your construction with the different
files/classes?

Best regards,
Cor van Dooren

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: dinsdag 6 september 2011 6:24
To: Flash Coders List
Subject: Re: [Flashcoders] DataGrid: save multidim arrayfrom Flash to mySQL
with PHP

Correction...

        _parent.status = this.status;
                        }
        };
        mylv.sendAndLoad("http://yourwebsite.com/process.php";, myreply,
"POST");
        _parent.status = "sending now ...";
//end while loop here
}

Best,
Karl

On Sep 5, 2011, at 11:20 PM, Karl DeSaulniers wrote:

> Hey Cor,
> This is how I have it set up in as2, you may be able to port easier 
> than I.
>
> send_btn.onRelease = function() {
>       //Creates a LoadVars and get values from the form
>       mylv = new LoadVars();
>       myreply = new LoadVars();
>       mylv.formTrue = "1"; //Verify were on our form
>       //could put a while loop here mylv.id = myArray[i]['id'];
>               mylv.id = id.text;
>               mylv.name = name_txt.text;
>               mylv.description = description.text;
>               //Show success or fails message
>               myreply.onLoad = function() {
>                       if(this.status === "Mail sent!") { //Success!
>                               newStatus = this.status + " - Thank you for
your response. We will 
> get in touch with you at "+email_txt.text+".<br><br>- Company";
>                               gotoAndPlay("send_off");
>                       } else if(this.status === "Mail Failed!"){//Mail
Failed with error
>                               _parent.status = this.status + "<br>Sorry
there was a problem 
> sending your message. Please try again or try again at a later time.
> We apologize for any inconvenience.";
>                       } else {
>                               _parent.status = this.status;
>                       }
>       //end while loop here
>       };
>       mylv.sendAndLoad("http://yourwebsite.com/process.php";, myreply, 
> "POST");
>       _parent.status = "sending now ...";
> }
>
> Obviously this is for a mail form and needs to be seasoned to taste, 
> but..
> HTH,
>
> Best,
> Karl
>
> On Sep 5, 2011, at 11:07 PM, Karl DeSaulniers wrote:
>
>> I think you may be able to use the php split() or explode() on a 
>> array of data sent.
>> but probably easier to split it up when gathering the info in flash.
>> multiple small queries instead of a bulky single query?
>>
>> Karl
>>
>>
>> On Sep 5, 2011, at 10:34 PM, Cor wrote:
>>
>>> Do you mean that is it not possible to send an array from Flash to 
>>> PHP in this way:
>>>
>>>     private function validateAndSend(e:MouseEvent):void {
>>>             form_variables = new URLVariables();
>>>             form_varSend=new URLRequest(Main.PHP_URL+"control.php");
>>>             form_varSend.method=URLRequestMethod.POST;
>>>             form_varSend.data=form_variables;
>>>             form_varLoader=new URLLoader  ;
>>>             form_varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
>>>             form_variables.sendRequest = "registreer_materiaal";
>>>             form_variables.VALUES = myMultiDimArray;
>>>             form_varLoader.addEventListener(Event.COMPLETE,
>>> completeLoadHandler);                       
>>>             form_varLoader.load(form_varSend);
>>>     }
>>>
>>>
>>> -----Original Message-----
>>> From: flashcoders-boun...@chattyfig.figleaf.com
>>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Dave 
>>> Watts
>>> Sent: dinsdag 6 september 2011 5:27
>>> To: Flash Coders List
>>> Subject: Re: [Flashcoders] DataGrid: save multidim arrayfrom Flash 
>>> to mySQL with PHP
>>>
>>>> My problem is how to fetch my $_POST['VALUES'], which is the 
>>>> multi-dimensional  array:
>>>>
>>>> myArray[0["id"]
>>>> myArray[0]["name"]
>>>> myArray[0]["description"]
>>>>
>>>> ...
>>>>
>>>> etc.
>>>
>>> I'm not a PHP expert, but in general you can't really submit an 
>>> array as form data directly to a CGI program. You have to post 
>>> name-value pairs - if you have a set of array values, they'd simply 
>>> end up having the same name and different values (like a checkbox 
>>> array in HTML, for example).
>>> In your
>>> case, things are a bit more complicated because you have an array of 
>>> structs, basically, so you'll need to convert those to a bunch of 
>>> individual name-value pairs in order to submit them to a CGI 
>>> program.
>>>
>>> Dave Watts, CTO, Fig Leaf Software
>>> http://www.figleaf.com/
>>> http://training.figleaf.com/
>>>
>>> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA 
>>> Schedule, and provides the highest caliber vendor-authorized 
>>> instruction at our training centers, online, or onsite.
>>>
>>> _______________________________________________
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>>> _______________________________________________
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>> _______________________________________________
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Karl DeSaulniers
Design Drumm
http://designdrumm.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to