I want to be able to show an output to the user when he tries to log in or sign up and he isn't able to. Ideally I want to be able to call a JavaScript
function from a file or at least call prompt()
or something like that. The code is the following:
<?php
include("../php/functions.php");
include("../php/connect.php");
do{
if(isset($_POST['submit-btn'])) {
$loggedIn = authenticate($conn, $_POST['email'], $_POST['password']);
if($loggedIn === null) {
/**TODO: Do something when the database couldn't be reached */
break;
}
if(!$loggedIn) {
/***TODO: Do something when the password is incorrect*/
break;
}
if($loggedIn)
header("Location: ../html/homepage.html");
}
}while(false)
?>
I get the data from $_POST['*value*']
after the user has submited it and I don't know how to show a, somewhat, presentable error message to he user.