Problem with Login page, redirect

Asked

Viewed 44 times

1

It works well, does not let pass the credentials that are not configured. But when redirecting it to the other, does not work.

session_start();

if (!empty($_POST)) {
    $isim = $_POST['login'];
    $sifre = $_POST['password'];

    var_dump($isim, $sifre);

    if($isim == 'teste' && password_verify($sifre, '$2y$10$OvT4fn4/S7cF2O4Rgr1hK.lhz0lKPaaEuyO/Bxn23HA7lFQEsCLoy')) {
        $_SESSION['auth'] = 1;

        header('Location: main.php');
        exit;
    }
}

After that she should redirect me to the page "main.php", but what appears is a blank screen. inserir a descrição da imagem aqui

If you want to access to observe:

username: test

password: test

https://raindroipstexter.000webhostapp.com/panel/login.php

I put this code, now I get other deleted errors.

error_reporting(E_ALL); ini_set('display_errors', 'On');

  • See what password_verify is returning var_dump(password_verify('teste', '$2y$10$OvT4fn4/S7cF2O4Rgr1hK.lhz0lKPaaEuyO/Bxn23HA7lFQEsCLoy'));

  • puts the var_dump inside the if to see if it is accepting as true, if not print anything on the screen is because the condition is not being true

  • If the var_dump is still being displayed, then it is true, after you confirm the deletion of your script, I believe you can not have anything output before the header

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.