Im testing my database and validation scripts in php. After changing the database password to run the error script, it is not displaying the message, but instead displaying a white blank page.
Im simply looking to display whatever the error message is. Here is my code:
Database.php
<?php
$host = "localhost";
$dbname = "login_db";
$username = "root";
$password = "xxx";
# connect to sql database
$mysqli = new mysqli($host, $username, $password, $dbname);
if ($mysqli->connect_errno) {
die("Connection error: " . $mysqli->connect_error);
}
return $mysqli;
Auth.php
$mysqli = require __DIR__ . "/database.php";
print_r($_POST);
I’ve tried changing the path of the php folder, but the results have been the same. Also, I’ve attached a screenshot of my text editor file path for more context.