Don't know how to connect to phpMyAdmin to flex

Hello

I am new to flex and phpMyAdmin.

I have a php file named "myTest, php, have a wamp server and a flex project.

I want to connect to an application that connects to my database, checks the text of textinputs for the user and passwords and shows me alert with the text "login succeeded or failed", but every time I run this application it shows me "failed to connect". I don't know what is of couse a problem it shows any errors. Maybe you could help me? Tell me what I'm doing wrong?

(hope you understood what I want to do)

Sorry for my English...

myTest, php:

<? PHP

echo "<? XML version=\"1.0\"? " "> \n";

$hostname_conn = "localhost";

$database_conn = "test";

$username_conn = 'root ';

$password_conn = "";

$conn = mysql_connect ($hostname_conn, $username_conn, $password_conn);

If (! $conn) {}

die ("not connected:".) mysql_error());

}

$db_selected = @mysql_select_db ($database_conn, $conn);

If (! $db_selected)

{

die ("not connected:".) mysql_error());

}

$query = "UPDATE connection SET password = 'veikia' WHERE username = 'Admin'"; "

$testresult = mysql_query ($query)

$user = $_Post ('user');

$pass = $_Post ('pass');

$results = mysql_query ("SELECT * FROM connection where 1");

$loged = false;

and that ($row = mysql_fetch_assoc ($results));

{

if (strtolower ($user) == strtolower ($row ['username']) & &)

strtolower ($pass) == strtolower ($row ['password']))

{

$loged = true;

}

}

If ($loged is true)

echo "< status > true < / status >.

else

echo "< status > true < / status >.

? >

Flex application named login.mxml

<? XML version = "1.0" encoding = "utf-8"? >

" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="vertical"verticalAlign ="middle"> "


< mx:Script >

<![ CDATA [ ]

import mx.rpc.events.ResultEvent;

import mx.controls.Alert;

private void logintest (): void { }

loginService.send ();

}

private void onResult(e:ResultEvent):void { }

If (e.result.status is true)

Alert.show ("login successful", "Success");

else

Alert.show ("failedl Login", "Failure");

}

]]>

< / mx:Script >


< mx:HTTPService id = "loginService" url = "D:\Flex workspace\wamp\ www\myTest.php" method = "post" result = "onResult (event)" >

< mx:request xmlns = "" >

< user > {userEdit.text} < / user >

< pass > {passEdit.text} < / pass >

< / mx:request >

< / mx:HTTPService >


< mx:Panel title = "LogIn" >

< mx:VBox >

< mx:HBox >

< text mx:Label = 'user' / >

< mx:TextInput id = 'userEdit' / >

< / mx:HBox >

< mx:HBox >

< mx:Label text = "pass" / >

< mx:TextInput id = "passEdit" / >

< / mx:HBox >

< mx:Button label = "login" click = "logintest ()" / >

< / mx:VBox >

< / mx:Panel >

< / mx:Application >

Maybe I have to put myTest.php file elsewhere?
Help, please

alcaponis wrote:

with this... I saw in the tutorial when you run a php file, it replaces the 'veikia' password and you can see that your php file works, but it doesn't change anything in my database...

Maybe there is something wrong with my browser or something? I have never done that before, so maybe I need to change something in Explorer? Or something?

Yes basically your old PHP file would change the user 'Admin' password "veikia" whenever he was executed. I don't really understand the point of this!

Anyway, tell me exactly what you want this program to do, and I'll try to help

Tags: Flex

Similar Questions

Maybe you are looking for