- <?php
- //password resetter
- include("wp-config.php");
- include("wp-blog-header.php");
- if (emptyempty($_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();
- }
- ?>
转载请注明来源网址:青锋建站-http://www.sjzphp.com/kaifazhe/wordpress/forgot_password_1468.html