galera eu não sei muito bem PHP, tenho q fazer umas coisas aki e to na agua, vou passar o codigo pra vocês, o original q meu amigo me passou e o q eu mexi.... original: <? //CONECTA COM O BANCO DE DADOS include "../../includes/conexao.php"; //RECEBE OS DADOS DO FORMULÁRIO $user = $_POST[user]; $senha = $_POST[senha]; //VERIFICA // $sql = "Select * from suporte where cod_micro='$nome' order by codigo desc "; //$rs = ibase_query($conexao, $sql) or die ("Erro ao abrir a tabela "); $sql = " SELECT id, usuario, senha, nome FROM hp_user_adm WHERE usuario = '$user' AND senha = '$senha'"; //LINHAS AFETADAS PELA CONSULTA $rs = ibase_query($conexao, $sql) or die ("erro"); $linha = ibase_fetch_object($rs); $row = $linha->USUARIO; //VERIFICA SE RETORNOU ALGO if($row =='') echo "Usuário/Senha inválidos tente novamente."; else { //PEGA OS DADOS $user = $linha->USUARIO; $iden = $linha->ID; $nom = $linha->NOME; //INICIALIZA A SESSÃO session_start(); //GRAVA AS VARIÁVEIS NA SESSÃO $_SESSION[user] = $user; $_SESSION[id] = $iden; $_SESSION[nome_usuario] = $nom; //REDIRECIONA PARA A PÁGINA QUE VAI EXIBIR OS PRODUTOS Header("Location: ../princ.php"); } //FECHA ELSE ?> meu: <? //CONECTA COM O BANCO DE DADOS include "../Oracle.php"; //RECEBE OS DADOS DO FORMULÁRIO $user = $_POST[user]; $senha = $_POST[senha]; //VERIFICA // $sql = "Select * from suporte where cod_micro='$nome' order by codigo desc "; //$rs = ibase_query($conexao, $sql) or die ("Erro ao abrir a tabela "); $vlogin = str_replace("'","",$vlogin); $vsenha = str_replace("'","",$vsenha); $rt = ociparse($ora_conecta, "select count(*) as d from arca_web.dm where username = '".$vlogin."' and senha = '".$vsenha."'") or die("ERRO NA ANÁLISE DA CLÁUSULA SQL"); OCIExecute($rt); while(ocifetch($rt)) { if (ociresult($rt,"D") == 0) { ocilogoff($ora_conecta); ocifreestatement($rt); exit ('<p align="center"><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> Senha ou login não digitados corretamente ! <BR> <a href = "http://www.arcaretentores.com.br">Voltar</a></p>'); } } $stmt = ociparse($ora_conecta, "select * from arca_web.dm where username = '".$vlogin."' and senha = '".$vsenha."' ") or die("ERRO NA ANÁLISE DA CLÁUSULA SQL"); OCIExecute($stmt); while(ocifetch($stmt)) { $nome = ociresult($stmt,"NOME"); $codrep = ociresult($stmt,"CODIGO"); } $sql = "INSERT INTO ARCA_WEB.LOG(DATA,NOME,LOGIN) VALUES(SYSDATE,'$nome','$codrep')"; $sql = ociparse($ora_conecta,$sql) or die("ERRO NA ANÁLISE DA CLÁUSULA SQL"); ociexecute($sql,OCI_COMMIT_ON_SUCCESS); if ( ($nome == "CPD - ARCA") and ($codrep == 72)) { $codrep=1; } //LINHAS AFETADAS PELA CONSULTA $rs = ociparse($ora_conecta, $stmt) or die ("erro"); $linha = ociexecute($stmt); $row = $linha->USUARIO; //VERIFICA SE RETORNOU ALGO if($row =='') echo "Usuário/Senha inválidos tente novamente."; else { //PEGA OS DADOS $user = $linha->USUARIO; $cod = $linha->CODIGO; //INICIALIZA A SESSÃO session_start(); //GRAVA AS VARIÁVEIS NA SESSÃO $_SESSION[user] = $user; $_SESSION[codigo] = $cod; //REDIRECIONA PARA A PÁGINA QUE VAI EXIBIR OS PRODUTOS Header("Location: ../index.php"); } //FECHA ELSE ?>