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"; useProxy="false" method="POST">
      <mx:request xmlns="">
         <passwordInput>{passwordInput.text}</passwordInput>
         <usernameInput>{usernameInput.text}</usernameInput>
      </mx:request>
    </mx:HTTPService>

this should post a basic login. 


if($_POST["passwordInput"] AND $_POST["usernameInput"])
{       $query= sprintf("SELECT login,password FROM utenti WHERE
login='$usernameInput'");
//------------------------------------------------------
//       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