You should look into amfphp for this kind of thing. Basically instead of 
using HTTPService, you use RemoteObject, and you don't have to worry at 
all about serializing your data on the PHP side. You should read this 
tutorial here:

http://sephiroth.it/tutorials/flashPHP/flex_remoteobject/

Patrick

theduderino82 a écrit :
>
> I come from php programming and I want to develop with flex. I found
> hard to find somewhere over the internet how to handle output from php
> file called with a HTTPService to the mxml. All I can find is
> tutorials on how to retrieve data from an xml file. I understand how
> to pass form items to the php page in order to update mysql but I
> can't figure out how to send back results from the database (possibily
> strings to be handled in an action script) or even worste how to
> handle mysql exception.
> something like this:
>
> <mx:HTTPService resultFormat= "text" id="logRequest"
> url="http://...url. ./connection. php 
> <http://...url../connection.php>" useProxy="false" method="POST" >
> <mx:request xmlns="">
> <passwordInput> {passwordInput. text}</passwordI nput>
> <usernameInput> {usernameInput. text}</usernameI nput>
> </mx:request>
> </mx:HTTPService>
>
> this should post a basic login.
>
> if($_POST["password Input"] AND $_POST["usernameInp ut"])
> { $query= sprintf("SELECT login,password FROM utenti WHERE
> login='$usernameInp ut'");
> //---------- --------- --------- --------- --------- --------
> // MYSQL STUFF
> //---------- --------- --------- --------- --------- -------
> $check="<check> ok</check> ";
>
> print ($check);
> }
>
> >From the Mike Potter Tutorial he used a print() with an xml string to
> populate a <datagrip>. So I made a small xml string
> "<check>ok</ check>" and printed.
>
> private function logCheck():void{
> logRequest.send( );
> Alert.show(" Check = "+logRequest. lastResult. check);
> }
>
> every time I get "Check = null". What am I doing wrong?
>
>  

Reply via email to