Flash Login System

Hi all,

Im wanting to create a flash login system, that runs through php then a mysql database. I did a search on google to see how i could achieve this and as a result have been following the following tutorial.

http://www.sephiroth.it/tutorials/flashPHP/authentication/index.php

But it doesnt quite suit what i need to do. I need multiple users stored in the mysql then when they log in they get a personalised message, but get the same screen. As an example much like when you login here, and you are presented with a welcome message and your username, but in flash.

While i want a personalised message and the balance of the user displaying i also need them to see the same screen. Ive set up some dynamic text fields for the personalised message as i thought this is how it might work, but im stuck now.

Hope ive made this clear, Any advice on this would be greatly appreciated.

Thanks.

You would use sendAndLoad. First, set up two loadVars objects. I usually name mine mysv (to send info to the php script) and mylv (to accept the response).

Then, you can pretty much just follow the example in the help docs for sendAndLoad

On the php side, you would create the script to check for the $_POST vars, and then check the database.

If the username/password combo is found, set a $_SESSION[‘logged’] = true and $_SESSION[‘username’] = $username

Then, just echo out a welcome message in urlencoded format like echo ‘&response=Welcome ‘.$_SESSION[‘username’].’! Nice to see you again’;

If the username/pass combo is not found, then just echo a error message instead of a welcome message.

If you don’t quite understand and need some code examples, just let me know, and I can help you out later tonight.

Hi,

Thanks for your reply.

I’m pretty new to AS so thats alot to try and work out for me, some code examples would be great if you have the time to do them.

Thanks once again.