<?php

/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT'getcwd());

/**
* Get the new password from GET/POST
*/
$password NULL;
if ((
is_array($_REQUEST)) && (array_key_exists('password'$_REQUEST)))
{
        
$password $_REQUEST['password'];
}

/**
* Check the password
*/
if (!$password)
{
    print(
'<form id="pwdrst" action="" method="GET"><p><label for="pwd">New password: </label><input id="pwd" name="password" type="password" /><input type="submit" /></p></form>');
    die();
}

$password urldecode($password);

require_once(
DRUPAL_ROOT '/includes/bootstrap.inc');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
require_once(
DRUPAL_ROOT '/includes/password.inc');
print(
'<p>To set the new password for administrator, please execute following query in your MySQL database: <br />');
print(
'<code>UPDATE `users` SET `pass`=\'' user_hash_password($password) . '\' WHERE `uid`=\'1\';</code></p>');
die();
?>