Login database

Hi. Another question. I want to create a login application in Macromedia Flash MX. What I need is for Flash MX to locate the database to check if the password is correct or not. Then, If the password is correct, I would like the user’s personal settings of the program I created on Flash to load using the data on the database. Is this possible at all? If so, can anyone help me out? Thanks a lot.

:tie:

do you have any experience with server side programming? :slight_smile:

I have none what-so-ever.

I think it is pussible !
I have seen a tutorial about this !
There is many sites that have this !
I will search and give you the link ! :run:

It’s very possible. You’ll need to have a storage place for the data (in your case, a mySQL database would be the best), a server-side language (i use PHP) and flash.

If you have access to a mySQL database and a PHP-enabled server, let know, i can help you with this :slight_smile:

I do have both a mySQL db and a PHP-enabled server… it’d be great if you could help me out.

Another option…

If you attend to have alot of users connecting to your site,
I highly recommend using SQL-server, if not use Access.

You can also use ASP as the Server-side language and SQLServer
Or Access as the Database. All you have to do is call the
code below from Flash using the loadmovie function and
create two textboxes and variables called Username and password in Flash
in Flash…thats about it.

ie. ASP page that calls a SQLServer Database, can easily changed
to access a Access Db.

  CnString="Provider=SQLOLEDB;Data Source=MyDatabaseName;Initial Catalog=MyTableName;User Id=MyUserId;Password=MyPassword;" 

  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open CNString
   
  'Retrieve UserName & Password from Flash
  sUserName= Request.QueryString("Username")
  sPassWord= Request.QueryString("Password")	  
   
  sSQL="select * "
  sSQL= sSQL + "From Users Where Password='" &  sPassWord "' and UserName='" & sUserName & "'"

  Set RS = Conn.Execute(sSQL)
   
  If NOT RS.EOF Then 'Valid UserId and Password
    'Do what you want
  Else 'Not a valid User
'do what you want...or display message to the user in flash ie.(assuming you have a text var)
 response.write "successfull=false" 'sent variable successfull to flash
  End If	
		 
  'Close All open Connections 
  RS.Close
  Set RS= Nothing
  Conn.Close
  Set Conn= Nothing

here is a tutorial for php mySQL database login:

http://www.daydreamgraphics.com/tutorials/list/details/2/87

and here is something for loading PHP variables into Flash:

http://www.flash-db.com/GuestBookTut/GuestBookDoc.php