I'm new to flex, and I would like to create a simple login + password using amfphp

Hi all

I try to make a simple connection using amfphp and mysql password, I have a small question, I don't ' know how to recover my answer of php. Thanks in advance if anyone could help me.

Best regards

I want to say to the tag < mx:Label x = "380" y = "10" id = "lResponse" / > php response

I just want to take over the response of php.

Here's my mxml:

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/halo" minWidth = "1024" minHeight = "768" >
< fx:Script >
<! [CDATA]
Import mx.controls.dataGridClasses.DataGridColumn;
import flash.net.Responder;
Import mx.events.DataGridEvent;
Import org.corlan.VOAuthor;

private void checkpassword (): void {}
var newauthor:VOAuthor = new VOAuthor();
NewAuthor.lname_aut = nom.text;
NewAuthor.fname_aut = prenom.text;
myRemote.validate (newauthor);

}
private function checkInput (): void
{
If (nom.text == "" |) first name. Text == "")
{
lResponse.text = ' Please fill all the fields;
}
on the other
{
lResponse.text = "connect";
CheckPassword();
checkLogin ("login. Verify.Validate", [name. Text, first name. Text]);
}
}
[]] >
< / fx:Script >
< fx:Declarations >
<! - Place non-visual elements (e.g., services, items of value) here - >
< mx:RemoteObject id = "myRemote" destination = "MyService" source = "MyService".
                         endpoint=" http://localhost/AMFPHP/gateway.php "showBusyCursor ="true"/ > "
< / fx:Declarations >

< s:Panel = "334" x = "168" width = "245" height = "135" title = "Log" textAlign = "center" >
< s:TextInput = "102" x = "10" textAlign = "left" id = "name" / >
< s:TextInput = "102" x = "40" textAlign = "left" id = "FirstName" / >
< s:RichText x = "50" y = "6" text = "" Login: "height ="22"width ="56"textAlign ="left"verticalAlign ="bottom"/ >"
< s:RichText = "27" x = "46" text = "" password: "height ="20"/ >"
< s:Button = "125" x = "70" label = "Connect" width = "105" click = "checkInput ()" / >
< mx:Label x = "380" y = "10" id = "lResponse" / >
< / s:Panel >
< / s:Application >

Here is my php code:

<? PHP
session_start();

require_once ('. / vo/org/corlan/VOAuthor.php');

Conection info
define ("DATABASE_SERVER", "127.0.0.1");
define ('DATABASE_USERNAME', 'root');
define ("DATABASE_PASSWORD", "xxxx");
define ('database_name', 'flex360');

class MyService {}

function validate ($author) {}

$mysql = mysql_connect (DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
@mysql_select_db (database_name);

$user = $author [0];
$pass = $author [1];

$query = "SELECT DISTINCT * from authors_aut WHERE fname_aut = '$user' AND lname_aut = '$pass" ";
$rs = mysql_query ($query);

$var = mysql_fetch_assoc ($rs);
$u = $var ["fname_aut"];
$p = $var ["lname_aut"];

If ($pass! = $p) {}
$response [0] = 'INVALID ';
$response [1] = 'invalid username or password ";
} else {}
$response [0] = "VALID";
$response [1] = 'welcome $u. '
}
Return $response;
}

}

? >

Try here:

http://www.vipercreations.com/tutorials/Adobe%20Flex/28.html

Tags: Flex

Similar Questions

Maybe you are looking for

  • What are the symbols below the post titles?

    the check mark that I receive, check mark green, resolved. What is the Red Star? I have however it could be new positions or those I had not read, but these two criteria appear not to be the case. What is the black Apple? If it was Apple feedback but

  • read from bit hex

    Hello world I have been using a touch screen for a project. I am now able to read hexadecimal values and convert them to decimals through LabVIEW. However, I need to be able to read the beginning bit everytime. Now, when I move my finger on the touch

  • The property node reference

    Hello guys,. Using the property node, I confused with the terminal of reference there. Can we establish a special reference to the control (button, for example), but obviouly I couldn't connect the button directly to the point of reference. I find an

  • OfficeJet 4634: "incompatible cartridge".

    Hello I've had my printer for about a month.  I only use HP 301 cartridges authentic when replace (just once) I came to replace again today and the Canadiens isfine, but it will not accept the B & W cartridge.  I cleaned the contacts as described, bo

  • Network to share Internet between a laptop XP SP2 and Vista Home Premium desktop

    I hope this is the right forum. I'm a graduate student in the field of information TECHNOLOGY as well as a few certifications, so I'll have people ask me some questions on how to troubleshoot certain aspects of their computer. Given that I have not l