I get this error with my login form, I did, but I'm not sure if this is a problem with my php code or

I get this error with my login form when I try to log in, but I'm not sure if this is a problem with my php code or my flex code!

ReferenceError: Error #1069: loginsuccess property not found on string and there is no default value.
CBC::main/checkLogin()
CBC::main/__login_user_result()
to flash. events::EventDispatcher / dispatchEv...
to flash. events::EventDispatcher / dispatchEv...
to HTTPOperation / http://www.Adobe.com/2006/Flex/MX/internal:dispatchRpcEvent ()
to mx.rpc::AbstractInvoker / http://www.Adobe.com/2006/Flex/MX/internal:resultHandler ()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
to the DirectHTTPMessageResponder/completeHandl...
to flash. events::EventDispatcher / dispatchEv...
to flash. events::EventDispatcher / dispatchEv...
at flash.net::URLLoader/onComplete()


my php code is:


[php] <? PHP

define ("DATABASE_SERVER", "localhost");

define ('DATABASE_USERNAME","f4r");

define ('DATABASE_PASSWORD', 'cool23');

define ('database_name', 'bignixs1');

connect to the database

$mysql = mysql_connect (DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die (mysql_error ());

Select the database

@mysql_select_db (DATABASE_NAME);

re-branded the data passed from Flex to variables

$username = mysql_real_escape_string ($_POST ["usernam...)

$password = mysql_real_escape_string ($_POST ["passwor...)

Ask the database to see if the combination of username/password given name is valid.

$query = "SELECT * from users WHERE username = 'username' AND password = 'password" ";

$result = mysql_fetch_array (mysql_query ($query));

start generating XML

$output = "< loginsuccess > ';

If the query returned true, exit < loginsuccess > Yes < / loginsuccess > other output < loginsuccess > not < / loginsuccess >

if(!$result)

{

$output. = « no » ;

} else {}

$output. = "yes";

}

$output. = "< / loginsuccess > ';

all the XML for output

print ($output);

? > [/php]

$query = "SELECT * from users WHERE username = 'username' AND password = 'password" ";

should be

$query = "SELECT * FROM users WHERE username = '$username' AND password =  '$password'";

example of a system of working with the correct connection code flex & php to ensure:

http://www.mattlefevre.com/viewExample.php?tut=flexPHP&proj=simple%20Login%20Application

Tags: Flex

Similar Questions

Maybe you are looking for