i am create file in webroot and included DefaultPasswordHasher.php but not working
require CAKE."/Auth/DefaultPasswordHasher.php";
$conn = new mysqli($servername, $username, $password,$dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$stmt = $con->prepare("SELECT * FROM `users` WHERE `email` = ?");
$username = $_POST['email'];
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) { // User doesn't exist
return false;
echo"No such username registered";
} else { // User exists
$row = $result->fetch_assoc();
if ((new DefaultPasswordHasher)->check($password, $row['password'])) {
return true;
} else {
return false;
}
}
Fatal error : Uncaught Error: Undefined constant “CAKE” in F:\app.jw-app.com\webroot\webapi.php:3 Stack trace: #0 {main} thrown in F:\app.jw-app.com\webroot\webapi.php on line 3