Hello, I'm new to PHP and am having the following error:
Call to undefined function PerformLogin ()
What can it be?
Code to call the function:
if(isset($_POST["btn-logar"]))
{
include_once('../Controller/Login/Logar.php');
RealizarLogin();
}
Function Code:
class Logar{
var $usuario;
var $senha;
function RealizarLogin($usuario, $senha)
{
$this->$usuario = $_POST['usuario'];
$this->$senha = $_POST['senha'];
$login = $conn->prepare('SELECT count(1) as qtd FROM login WHERE usuario=:usuario AND senha=:senha');
$login->bindParam(':usuario',$usuario);
$login->bindParam(':senha',$senha);
$login->execute();
$retorno = $login->fetchAll();
if($retorno[0]['qtd'] > 0)
{
session_start();
$_SESSION['usuario'] = $usuario;
$_SESSION['senha'] = $senha;
print "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../View/System/Home.php'>";
} else {
print "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../View/Error/Error1.php'>";
}
}