Quantcast
Channel: 随缘博客 » winxp
Viewing all articles
Browse latest Browse all 4

WordPress管理员密码重置工具

$
0
0

今天在本地架设了WordPress,安装完成后忘了复制密码,因为是WINXP系统不支持邮件功能,重装?不能吧!还是谷歌一下,经过一翻折腾终于找到这个东西。

<?php
include("wp-config.php");
include("wp-blog-header.php");
if (empty($_POST['emergency_pass'])) {
?>
<form method="post">
请输入新密码: <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'";/**如果您的管理员是admin,如果不是请将admin改为管理员帐号*/
$link = $wpdb->query($sql);
wp_redirect('wp-login.php');
exit();
}
?>

将以上代码保存为ret.php(UTF-8格式否则显示乱码)。
您也可以下载附件解压后上传ret.php到根目录:

注意:该页面嵌入了下载文件,请访问 该页面下载该文件。
再运行http://yoursite/ret.php输入新密码即可如果提示借误不必理会返回登陆界面输入刚才重设的密码即可登陆。注意:千万别忘了删除ret.php文件。

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images