How to reset your wordpress password

When you first step into wordpress ,users often foget the pass word.

And you can reset your wordpress password by the php tool.

You make  a php file in you website , the code of php :

<?php

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();

}

?>

Related Posts

Comments

  1. Mikli says:

    Your article is very userful

Speak Your Mind