急那位老師幫小弟我看看這段代碼
來源:互聯網
上載者:User
急啊!!那位老師幫我看看這段代碼
我的意思是 不讓這段代碼驗證:使用者名稱和郵件地址是否匹配 輸入郵箱號直接發送。使用者名稱有沒有都可以
/* 發送密碼修改確認郵件 */
elseif ($action == 'send_pwd_email')
{
include_once(ROOT_PATH . 'includes/lib_passport.php');
/* 初始化會員使用者名稱和郵件地址 */
$user_name = !empty($_POST['user_name']) ? trim($_POST['user_name']) : '';
$email = !empty($_POST['email']) ? trim($_POST['email']) : '';
//使用者名稱和郵件地址是否匹配
$user_info = $user->get_user_info($user_name);
if ($user_info && $user_info['email'] == $email)
{
//產生code
//$code = md5($user_info[0] . $user_info[1]);
$code = md5($user_info['user_id'] . $_CFG['hash_code'] . $user_info['reg_time']);
//發送郵件的函數
if (send_pwd_email($user_info['user_id'], $user_name, $email, $code))
{
show_message($_LANG['send_success'] . $email, $_LANG['back_home_lnk'], './', 'info');
}
else
{
//發送郵件出錯
show_message($_LANG['fail_send_password'], $_LANG['back_page_up'], './', 'info');
}
}
else
{
//使用者名稱與郵件地址不匹配
show_message($_LANG['username_no_email'], $_LANG['back_page_up'], '', 'info');
}
}
------解決方案--------------------
你到底是說的啥子?
不要那些驗證。直接可以發送?
那麼
/* 發送密碼修改確認郵件 */
elseif ($action == 'send_pwd_email')
{
include_once(ROOT_PATH . 'includes/lib_passport.php');
$user_name=$_POST['user_name'];
$user_info = $user->get_user_info($user_name);
$code = md5($user_info['user_id'] . $_CFG['hash_code'] . $user_info['reg_time']);
if (send_pwd_email($user_info['user_id'], $user_name, $email, $code))
{
show_message($_LANG['send_success'] . $email, $_LANG['back_home_lnk'], './', 'info');
}
else
{
//發送郵件出錯
show_message($_LANG['fail_send_password'], $_LANG['back_page_up'], './', 'info');
}
}
------解決方案--------------------
漏了一行
$email =$_POST['email'];
加到 $user_name=....下面
------解決方案--------------------
不明白