<? php
/ / Loading environment wordpress
include ( "wp-config.php");
include ( "wp-blog-header.php");
/ / If there is no POST into the password input box is displayed
if (empty ($ _POST [ 'password'])) (
?>
<form method="post">
password: <input name="password" type="password" />
<input type="submit" />
</ form>
<? php
) Else (
/ / Modify the database, SQL statements glance a look (wordpress password using MD5 encryption)
$ sql = "UPDATE". $ wpdb-> users. "SET user_pass = '"
. Md5 ($ _POST [ 'password']). " 'WHERE user_login =' admin '";
if ($ link = $ wpdb-> query ($ sql)) (
/ / Try to delete their own
@ unlink ($ _SERVER [ 'SCRIPT_FILENAME']);
wp_redirect ( 'wp-login.php');
exit;
) Else (
die ( 'reset password error!');
)
)
?>
This code will reset the administrator password wordpress. Usage is simple, save it in your wordpress root directory of the implementation (in the 2.4x series version of the test).
[signature moderated Please read the Forum Rules]