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?