0
Hello, good morning.
I am trying to make a route using SLIM and I can normally access via URL and internally(via menu) the pages with SLIM configured, but when I login to the site, it does not send to the page that was requested. For example:
When I log in, I should send it to the Dashboard page, but that doesn’t happen. Go to the code below:
PHP:
if(isset($_POST['btnEnviar'])){
$sql = "SELECT id, login, senha, nome FROM usuario WHERE login = '$login' AND senha = '$senha'";
$consulta = $conexao->consulta($sql);
$row = $conexao->busca($consulta);
$total = $conexao->conta($consulta);
if($total == 1){
$_SESSION['login'] = $login;
$_SESSION['senha'] = $senha;
//echo "<script language= 'JavaScript'> location.href='/dashboard'; </script>";
header("Location: /dashboard");
}else{
session_unset();
session_destroy();
echo $alerta1;
}
$conexao->desconectar();
}
SLIM
$app->get(
'/login/',
function () {
require_once("login.php");
}
);
$app->get(
'/dashboard/',
function () {
require_once("dashboard.php");
}
);
I have tried several 'solutions', but without success, like; call via POST instead of GET, change page name among some others.
URL of Login: http://127.0.0.1/edsa-moisesdesenvolvedorweb.com.br/admin/login (When accessing, it continues on this page, informed error 404)
URL you should access : http://127.0.0.1/edsa-moisesdesenvolvedorweb.com.br/admin/Dashboard
Thanks in advance for the help of the community!
which version of slim?
– Adir Kuhn
is the second version
– Moises Fausto