Postingan lainnya
Error notice: undefined index: password in d:\xampp\htdocs\blog\tambah.php on line 7
ini kenapa ya error Notice: Undefined index: password in D:\xampp\htdocs\blog\tambah.php on line 7
source code :
<?php
include 'functions/db.php';
if (isset($_POST['login'])) {
$username = mysqli_real_escape_string($con,$_POST["username"]);
$password = mysqli_real_escape_string($con,$_POST["password"]);
$result = mysqli_query($con,"SELECT * FROM tb_user WHERE username = '$username'");
//cek username
if (mysqli_num_rows($result) === 1) {
//cek password
$row = mysqli_fetch_assoc($result);
if(password_verify($password, $row["password"])){
header("location : hal_admin.php");
exit;
}
}
}
?>
0
2 Jawaban:
itu klo di debug $_POST['password'] ada isinya nggak?
0
Arti error Undefined index: "password" berarti variable ini belum terbaca
Disini kamu pakai if(password_verify($password, ...// variable password padahal sebelumnya belum didefinisikan $password itu apa.
0