File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/reset_passwords.php
Back
<?php require_once __DIR__ . '/config/config.php'; require_once __DIR__ . '/config/database.php'; $db = Database::getInstance(); $users = [ 'admin' => 'Admin@123', 'customer' => 'Customer@123', 'seller' => 'Seller@123', ]; foreach ($users as $username => $plainPassword) { $hash = password_hash($plainPassword, PASSWORD_BCRYPT); $stmt = $db->prepare("UPDATE users SET password = :hash WHERE username = :username"); $stmt->execute(['hash' => $hash, 'username' => $username]); // Verify immediately $check = $db->prepare("SELECT password FROM users WHERE username = :u"); $check->execute(['u' => $username]); $stored = $check->fetchColumn(); $ok = password_verify($plainPassword, $stored) ? 'OK' : 'FAIL'; echo "[$ok] $username => " . substr($hash, 0, 30) . "...\n"; } echo "\nAll done! Passwords updated successfully.\n";
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings