Jump to content

zorrotwee

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by zorrotwee

  1. The code looks complicated to me, but then again I still don't know a lot of programming.

     

    If I enter the code in flash (macromedia) it tells me the code isn't correct.

     

     

     

    When I do enter it and try to run the movie it says:

     

    Scene=Scene 1, Layer=Layer 2, Frame=1: Line 3: ';' expected

    private function onLoginButtonClick(e:Event):void {

     

    Scene=Scene 1, Layer=Layer 2, Frame=1: Line 12: ';' expected

    var loader : URLLoader = new URLLoader();

  2. If been reading tons of tutorials on this and tried it on multiple ways, but it doesn't seem to be working. Why is that?

    Can enybody help me out.

     

    This is the script I came out with:

     

     

    1. MySQL:

    - i've created a table userLogin with 3 colums : id, username, password

     

    2. Flash:

    I got a very simple form being: 1 button btn_ok, 2 input fields named txt_login and txt_password, 1 dynamic foeld txt_result

    In the first frame of scene 1 this script.

     

    btn_ok.onRelease = function() {

    var myLogin:String = txt_login.text;

    var myPassword:String = txt_password.text;

    maVariable = new LoadVars();

    maVariable.var_login = myLogin;

    maVariable.var_password = myPassword;

    maVariable.onLoad = function() {

    if (maVariable.allow == "1") {

    //actions

    } else {

    txt_result.text = "Login/Password incorrect";

    }

    };

    maVariable.sendAndLoad("login.php", maVariable, "POST");

    };

     

     

    3. PHP: (login.php)

     

    <?php

    session_start() ;

     

    $login = $_POST["var_login"] ;

    $password = md5($_POST["var_password"]);

     

    if ( $login != '' && $password != '' )

    {

    $requete = "SELECT username FROM userLogin WHERE username = '$login' AND password = '$password'" ;

     

    $server = "localhost";

    $basededonnees = "fa225635" ;

    $utilisateur = "******" ;

    $mdp = "fa225635_Members" ;

     

    $connection = mysql_pconnect($server,$utilisateur, $mdp) ;

    $choix_db = mysql_select_db($basededonnees, $connection) ;

    $resultat = mysql_query($requete,$connection) ;

    mysql_close($connection);

     

    $result = mysql_fetch_array( $resultat ) ;

     

    if ( $result['username'] == $login )

    { echo 'allow=1' ; }

    else

    { echo 'allow=0' ; }

    }

    else { echo 'allow=0' ; }

    ?>

     

×
×
  • Create New...