作者bigduck123 (qqq)
看板Programming
标题[问题] php帐号密码无法登入後端管理介面问题
时间Sun Oct 21 22:59:31 2007
我是改别人的程式 但是我只有网站程式没有资料库资料
所以我重建资料库TABLE在我的MYSQL里面
但是我发现 我用前人设定的帐号密码无法登入後端管理介面
这是因为 程式设定的帐号密码无法跟我重建的资料库做验证 才无法登入
还是纯粹只是我帐号密码错误跟资料库无关
因为这个网站程式密码有做加密程序 我也不知道要改哪里的程式
才有办法登入 请各位大大帮个忙 谢谢!!
-----------------------------------------------------------
password.php
<?
// A function that accepts a parameter to specify a length, and then returns
// a random password with characters and letters
function random_chr($length = 8, $charcase = 'all') {
// Declare a blank string to start from
$pass = '';
switch ($charcase)
{
case 'num':
$case = 0;
break;
case 'upper':
$case = 1;
break;
case 'lower':
$case = 2;
break;
}
// Now loop for as many times as the length
for ($i = 0; $i < $length; $i++) {
// For this character, first give an equal chance of upper,lower,num
if ($charcase == 'all')
$case = rand(0,2);
switch ($case) {
case 0:
// Generate a Number from 0 to 9
$pass .= rand(0,9);
break;
case 1:
// Generate a letter from A to Z via ascii values 65 to 90
$pass .= chr(rand(65,90));
break;
default:
// Instead use a letter from a to z, via ascii 97 to 122
$pass .= chr(rand(97,122));
}
}
// Return that password!
return $pass;
}
require_once('configuration.php');
$iwebConf_encrypt_1 = 'root';
$iwebConf_encrypt_2 = 'root';
$password = random_chr(6, 'lower');
echo '乱数产生的密码:'.$password.'<br>';
echo md5($iwebConf_encrypt_1.$password.$iwebConf_encrypt_2);
?>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.229.176.227