Benim PHP Kod NO olursa olsun, bir kullanıcı adı ve parola her zaman döndürür.
Flex / MXML kodu:
<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 kodu:
private function callZend():void {
zendAMF.doLogin();
}
PHP kodu:
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';
}
}
}