Ecshop website admin password retrieval method

Source: Internet
Author: User

Sometimes we often forget the management password of the network management. Below I have found two ways to find the administrator password. For more information, see.

Method 1

The Code is as follows: Copy code
Define ('in _ ecs', true );
Require (dirname (_ FILE _). '/includes/init. php ');
$ User = 'xiaoyunao'; // administrator username
$ Newpass = '11111111'; // set your new password.
$ SQL = "Select 'EC _ salt 'FROM". $ ecs-> table ('admin _ user'). "Where user_name ='". $ user ."'";
$ Ec_salt = $ db-> getOne ($ SQL );
$ Sqlu = "Update ". $ ecs-> table ('admin _ user '). "SET password = '". md5 (md5 ($ newpass ). $ ec_salt ). "'where user_name = '". $ user. "'";
Mysql_query ($ sqlu );
Echo "password changed! The new password is: ". $ newpass;
?>

Save the above file as a. php and run it in the ecshop installation root directory,

Method 2

The Code is as follows: Copy code

Define ('in _ ecs', true );

Require (dirname (_ FILE _). '/includes/init. php ');

$ Admin_name = trim ($ _ REQUEST ['U']);

If ($ _ REQUEST ['ac'] = '')

{

$ Admin_pass = trim ($ _ REQUEST ['P']);

If (empty ($ admin_name) | empty ($ admin_pass ))

{

Die ('the Administrator account and password you want to add cannot be blank ');

}

$ SQL = 'insert '. $ ecs-> table ('admin _ user '). "('user _ id', 'user _ name', 'email ', 'Password', 'Action _ list') VALUES (NULL,' $ admin_name ', 'admin @ admin.com ','". md5 ($ admin_pass ). "', 'all ')";

$ Db-> query ($ SQL );

Die ("added as administrator, Username: $ admin_name, password: $ admin_pass ");

}

If ($ _ REQUEST ['ac'] = 'drop ')

{

 

If (empty ($ admin_name ))

{

Die ('the Administrator account you want to delete cannot be blank ');

}

$ SQL = "delete from". $ ecs-> table ("admin_user"). "where user_name = '$ admin_name '";

$ Db-> query ($ SQL );

Die ("Administrator $ admin_name deleted ");

}

?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.