Problems with a login system using flash mx

hi there,
i am trying to do a form to login/password for my site, but something isn’t working…it let passes anyone…

here is the php script:

$busca = mysql_query(“select * from usuarios where nome=’”.$nome."’ and senha=’".$senha."’");
if($busca){
$registros = mysql_fetch_array($busca);
$nome_usuario = $registros[‘nome’];
$senha_usuario = $registros[‘senha’];
$email_usuario = $registros[‘email’];
$permissao_usuario = $registros[‘permissao’];
$id_usuario = $registros[‘id’];
$passagem = “concedida”;
echo “nome_usuario=”.$nome_usuario."&senha_usuario=".$senha_usuario."&email_usuario=".$email_usuario."&permissao_usuario=".$permissao_usuario."&id_usuario=".$id_usuario."&passagem=".$passagem;
}else{
$passagem = “negada”;
echo “passagem=”.$passagem;
}

the flash code in the login button:

on(release){
envia_login = new LoadVars();
recebe_login = new LoadVars()
envia_login.nome = nome1.text;
envia_login.senha = senha1.text;
recebe_login.onLoad = function(){
if(this.passagem == “concedida”){
objeto_usuario = SharedObject.getLocal(“perfil_usuario”, “/”);
objeto_usuario.data.nome = this.nome_usuario;
objeto_usuario.data.email = this.email_usuario;
objeto_usuario.data.permissao = this.permissao_usuario;
objeto_usuario.data.senha = this.senha_usuario;
objeto_usuario.data.id = this.id_usuario;
objeto_usuario.data.passagem = this.passagem;
objeto_usuario.data.flush();
getURL(“principal.html”, “_self”)
getURL(“javascript:alert(’”+this.passagem+"’)");
}else{
getURL(“javascript:alert(‘Login/Senha incorretos…Por favor, tente novamente.’)”);
nome1.text = “”;
email1.text = “”;
}
}
envia_login.sendAndLoad(“login.php”, recebe_login, “post”);
gotoAndStop(3);
}

in php i select the user and password, if it’s correct (the options match…) then i return a lot of info, in flash i will use sharedobjects to keep the info of the loged user…

if it don’t return true, the login process don’t proceed…

but the problem with this code is that any login/password is accepted…

could anyone give me a hand?

     $query = "SELECT * FROM forumUsers WHERE nome= '$nome' AND senha= '$senha'";

    // Execute the query
    $busca = mysql_query($query);

and [AS]envia_login.sendAndLoad(“login.php”, recebe_login, “post”); [/AS]
should be
[AS] envia_login.sendAndLoad(“login.php”, recebe_login, “POST”);[/AS]
send me your fla & script…

here is the files, this you told me to do didn’t work.
php may be case sensitive , but sql don’t. actionscript isn’t case sensitive too, so, these changes don’t real “change” the result…

if you could take a look in the files and tell me something i would appreciate…

the “usuarios” table is like this:
id int(6) auto_increment primary key,
nome varchar(10)
email varchar(100)
senha varchar(6)
permissao char(1)

this problem i could solve it yesterday before i go to class, using sharedobjects, as you can see, i will keep track of the users and something more, this is just tests.

in the principal.html a simple:
if(sharedobject.data.nome == “”)
resolved my problem, not in a good way , but id did work in the end…but i am trying to figure it out, why even an unregistred user can log in… i had a html / php / mysql / cookie application that worked with this same script php…(but not the flash part, of course)…

well buddy, i don’t know where to search for help anymore…if you or someone could help me in this one…

thanks…