Password encryption mode of the users table in echsop

Source: Internet
Author: User
I made a website using the password encryption method in the echsop users table, but I want to access the ecshop users table for logon. However, the ecshop users password is encrypted, after checking the compile_password method of ecshop, I still don't know how to use the encryption method. & Lt ;? Phpfunct echsop users table password encryption method
I made a website myself, but I want to access the ecshop users table for logon. However, the ecshop users password is encrypted and the ecshop compile_password method is viewed, I still don't know how to use encryption.
 Function compile_password ($ cfg)
{
// Var_dump ($ cfg );
If (isset ($ cfg ['password'])
{
$ Cfg ['md5password'] = md5 ($ cfg ['password']);
}
If (empty ($ cfg ['type'])
{
$ Cfg ['type'] = PWD_MD5;
}

Switch ($ cfg ['type'])
{
Case PWD_MD5:
If (! Empty ($ cfg ['EC _ salt '])
{
Return md5 ($ cfg ['md5password']. $ cfg ['EC _ salt ']);
}
Else
{
Return $ cfg ['md5password'];
}

Case PWD_PRE_SALT:
If (empty ($ cfg ['Salt'])
{
$ Cfg ['Salt'] = '';
}

Return md5 ($ cfg ['Salt']. $ cfg ['md5password']);

Case PWD_SUF_SALT:
If (empty ($ cfg ['Salt'])
{
$ Cfg ['Salt'] = '';
}

Return md5 ($ cfg ['md5password']. $ cfg ['Salt']);

Default:
Return '';
}
}






$ Con = mysql_connect ("localhost", "admin ","");

If (! $ Con ){
Die ('could not connect: '. mysql_error ());

}
$ Command = mysql_select_db ("yihaichao", $ con );
Mysql_query ('set NAMES gbk ');
If (! $ Command ){
Exit ('database connection failed ');
}
If (! Isset ($ _ POST ['submit ']) {
Exit ('failed to pass the value ');
}
$ Passowrd =$ _ POST ['password'];
$ Username = $ _ POST ['username'];
$ Passowrd = md5 ($ password );
Echo $ passowrd;
If ($ username & $ passowrd ){

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.