Olá! Estou fazendo um upgrade no meu site devido os antigos mysql foram evoluidos para mysqli, bom estou tendo problemas com o formulário de login, alguém poderia me ajudar, vou mandar o código e o erro:
Código:
<?php
include("Config.php");
function LimparTexto($texto){
$texto=str_replace(array("<", ">", "\\", "/", "=", "'", "?"), "", $texto);
return $texto;
}
$login = LimparTexto($_POST["login"]);
$senha = LimparTexto($_POST["senha"]);
$resultado = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM usuarios WHERE login = '$login' ");
$linhas = mysqli_num_rows($resultado);
while ($linha = mysqli_fetch_array($resultado)){
$rank = $linha["cargo"];
$foto = $linha["foto"];
}
if ($linhas == ){
header("Location: logar.php?fail=aviso");
}else {
if ($senha != mysql_result($resultado, , "senha")){
header("Location: logar.php?fail=incorreto");
}else{
if ($rank == Locutor){
session_start();
$_SESSION["login_user"] = $login;
$_SESSION["senha_user"] = $senha;
$_SESSION["rank"] = $rank;
$_SESSION["foto"] = $foto;
header("Location: index.php");
}else {
$rank == Administrador;
session_start();
$_SESSION["login_user"] = $login;
$_SESSION["senha_user"] = $senha;
$_SESSION["rank"] = $rank;
$_SESSION["foto"] = $foto;
header("Location: index.php");
}
}
}
((is_null($___mysqli_res = mysqli_close($conecta))) ? false : $___mysqli_res);
?>
erro ao efetuar o login:
Warning: mysql_result() expects parameter 1 to be resource, object given in /home/radioult/public_html/Admin/FuncLogar.php on line 18
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/radioult/public_html/Admin/FuncLogar.php:18) in/home/radioult/public_html/Admin/FuncLogar.php on line 30
Warning: Cannot modify header information - headers already sent by (output started at /home/radioult/public_html/Admin/FuncLogar.php:18) in /home/radioult/public_html/Admin/FuncLogar.php on line35