An Application with functions : Register, Login, Update Password, and Delete account
- Create new database
- Create table users
- Create 3 column : user_id,username,password
Create DbConnect.php
$host = 'localhost'; // hostname
$db = 'SIS'; // database name
$user = 'root'; // user
$pass = ''; // password
$charset = 'utf8mb4';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try {
$pdo = new PDO($dsn, $user, $pass, $options);
} catch (\PDOException $e) {
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
and Copy Api.php to same folder with DbConnect.php
if you are using Xampp change on URLs.class
String ROOT_URL = "https://localhost/{directory name}/Api.php?apicall="