first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// reset_password.php
|
||||
require_once 'config.php';
|
||||
|
||||
$username = 'admin';
|
||||
$password_baru = 'yaraaqmal';
|
||||
|
||||
// Mengubah teks polos menjadi hash Bcrypt yang sah di mata PHP
|
||||
$password_hash = password_hash($password_baru, PASSWORD_DEFAULT);
|
||||
|
||||
$stmt = $conn->prepare("UPDATE users SET password = ? WHERE username = ?");
|
||||
$stmt->bind_param("ss", $password_hash, $username);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
echo "<h3>✅ Password admin berhasil di-hash & diperbarui menjadi: <b>$password_baru</b></h3>";
|
||||
echo "<p>Silakan hapus file <b>reset_password.php</b> ini demi keamanan, lalu coba login kembali di halaman utama.</p>";
|
||||
} else {
|
||||
echo "❌ Gagal mereset password: " . $conn->error;
|
||||
}
|
||||
$stmt->close();
|
||||
?>
|
||||
Reference in New Issue
Block a user