Hi guys, I am trying to test the data I am getting from httpService, but I don't know how to access it.
This is my httpService:
<mx:HTTPService id="loginRequest" url="http://localhost/login.php" useProxy="false" method="POST" >
<mx:request xmlns="">
<username>{username.text}</username>
<password>{password.text}</password>
</mx:request>
</mx:HTTPService>
the login.php is testing if the pass is match, this is how its looks like:
<?php
define( "DATABASE_SERVER", "localhost" );
define( "DATABASE_USERNAME", "root" );
define( "DATABASE_PASSWORD", "" );
define( "DATABASE_NAME", "test2" );
//connect to the database.
$mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
mysql_select_db( DATABASE_NAME );
$quary="SELECT * FROM users WHERE username='".$_POST['username']."'";
$Result = mysql_query($quary);
$User = mysql_fetch_object( $Result );
$Return = "<user><username>"."wrong"."</username></user>";
if ($_POST['password']==($User->password))
$Return = "<user><username>".$User->username."</username></user>";
mysql_free_result($Result);
mysql_close($mysql);
echo ($Return);
?>
Now I wont to see what the login.php found, was it the correct pass or not, I was trying lots of thing but I have no idea how to do it.
This is what I was trying at the lost time:
<mx:Script>
<![CDATA[
private function login():void
{
loginRequest.send();
Alert.show(loginRequest.lastResult.user,"Testing");
}
]]>
the funny thing that I have no problem to put this on dataGrid, it works fine, just cant test the data only post it