-
-
Save fritids/55d2362d2bee0c75083e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//password resetter | |
include("wp-config.php"); | |
include("wp-blog-header.php"); | |
if (empty($_POST['emergency_pass'])) { | |
?> | |
<form method="post"> | |
set admin password: <input name="emergency_pass" type="password" /> | |
<input type="submit" /> | |
</form> | |
<?php | |
} else { | |
$sql = "UPDATE ".$wpdb->users." SET user_pass = '".md5($_POST['emergency_pass'])."' WHERE User_login = 'admin'"; | |
$link = $wpdb->query($sql); | |
wp_redirect('wp-login.php'); | |
exit(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment