My PHP Code returns always NO regardless there is a username and password.
Flex/MXML code:
<mx:RemoteObject id="zendAMF" destination="zend" showBusyCursor="true" source="test_class" >
<mx:method name="doLogin" result="onSayHelloResult(event)">
<mx:arguments>
<username>
{username.text}
</username>
<password>
{password.text}
</password>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
ActionScript code:
private function callZend():void {
zendAMF.doLogin();
}
PHP code:
class test_class {
public function __construct() {
}
public function doLogin($username,$password) {
include("connection.php");
if (isset($_POST['username']) && isset($_POST['password']))
{
$username= $_POST['username'];
$password= $_POST['password'];
$query = "SELECT *
FROM users
WHERE username = '".mysql_escape_string($username)."'
AND password = '".mysql_escape_string($password)."'";
$result = mysql_fetch_array(mysql_query($query));
return 'yes';
}
else
{
return 'no';
}
}
}