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.
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 returningvar_dump(password_verify('teste', '$2y$10$OvT4fn4/S7cF2O4Rgr1hK.lhz0lKPaaEuyO/Bxn23HA7lFQEsCLoy'));
– Juven_v
Possible duplicate of Error - "Cannot Modify header information - headers already sent"
– Woss
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
– Woton Sampaio
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
– Woton Sampaio