18 lines
499 B
PHP
18 lines
499 B
PHP
<?php
|
|
// Example to add a user with hashed password
|
|
include("functions.php");
|
|
$conn = connectDb();
|
|
|
|
$username = 'fire';
|
|
$password = 'egfh2204'; // Plain password, to be hashed
|
|
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
|
|
|
// Insert the user into the users table
|
|
$stmt = $conn->prepare("INSERT INTO users (username, password) VALUES (?, ?)");
|
|
$stmt->bind_param("ss", $username, $hashedPassword);
|
|
$stmt->execute();
|
|
$stmt->close();
|
|
|
|
echo "User added successfully!";
|
|
$conn->close();
|
|
?>
|