Welcome, Guest
  • Author Topic: Flash login to My Sql  (Read 2502 times)

    ac

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Flash login to My Sql
    « on: 09/08/05, 11:55 »
    Ok I have a flash intro and login in a index.html, ASP code in file called login2.asp and My SQL Server database.
    I can't connect on a login.

    ASP code in its own file:

    <%@LANGUAGE="VBSCRIPT"%> <%

    Dim myconnection__strUserID
    myconnection__strUserID = "x"
    if(Request.Form("UserID") <> "") then myconnection__strUserID = Request.Form("UserID")

    Dim myconnection__strPassword
    myconnection__strPassword = "1"
    if(Request.Form("Password") <> "") then myconnection__strPassword = Request.Form("Password")

    %> <%
    set myconnection = Server.CreateObject("ADODB.Recordset")
    myconnection.ActiveConnection ="dsn=k_FlashLogin;"
    myconnection.Source = "SELECT *  FROM Login  WHERE UserID = '" + Replace(myconnection__strUserID, "'", "''") + "' AND Password = '" + Replace(myconnection__strPassword, "'", "''") + "'"
    myconnection.CursorType = 0
    myconnection.CursorLocation = 2
    myconnection.LockType = 3
    myconnection.Open
    myconnection_numRows = 0
    %>
    <% If myconnection__strUserID <> "x" Then
    If Not myconnection.EOF Then
    Response.Write "login=Granted"
    else
    Response.Write "login=Denied"
    End If
    End If
     %>

    Flash button code:

    on (release, keyPress "<Enter>") {
        if (UserID eq "") {
            output = "You Must Enter A Login ID";
            output2 = "";
        } else if (Password eq "") {
            output = "You Must Enter A Password";
            output2 = "";
        } else {
            loadVariablesNum("login2.asp", 0, "POST");
            play();
        }
    }


    Actions Line:

    frame 1:
    setProperty("", _focusrect, false);
    UserID = "";
    Password = "";
    stop();

    frame 2:
    loadVariables("login2.asp", "", "POST");

    frame 3:output = "Accessing Database";
    output2 = "Please wait";

    frame 19:
    if (login ne "") {
        if (Login eq "Granted") {
            gotoAndPlay("Granted");
        } else if (Login eq "Denied") {
            gotoAndPlay("Denied");
        }
    }

    frame 20:
    output = "Access Denied";
    output2 = "Try Again";

    frame 40:
    gotoAndPlay(1);

    frame 41:
    output = "Login Verified";
    output2 = "Welcome";
    UserID = "";
    Password = "";

    frame 45:
    stop


    Any help would great. I got this script at Flashkit.com and would love it to work. Thanks again.


    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: Flash login to My Sql
    « Reply #1 on: 09/08/05, 13:36 »
    wgy you use  loadVariablesNum("login2.asp", 0, "POST");???

    you must have two objects LoadVars , one for send and the other to the request...
    take a look at tutorial written by jorge solis

    http://www.flash-db.com/Tutorials/loading/

    ac

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: Flash login to My Sql
    « Reply #2 on: 09/08/05, 14:18 »
    I have an ASP page that some guy wrote and I have embeded flash into that page and its going to call itself. How do I make it call itself and pass variables to page?

    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: Flash login to My Sql
    « Reply #3 on: 09/08/05, 15:11 »
    you can test something like this:


    loadVariables
    ("login.asp"this"POST");


    this will send all the variables at this object or movieclip with POST.