답변 4개
채택된 답변
+20 포인트
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
6년 전
/bbs/password_lost2.php 파일 소스 입니다.
</p>
<p><?php
include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');</p>
<p>if ($is_member) {
alert_close('Bạn đã đăng nhập từ trước.', G5_URL);
}</p>
<p>if (!chk_captcha()) {
alert('Nhập sai số ngăn chặn đăng ký tự động.');
}</p>
<p>$email = trim($_POST['mb_email']);</p>
<p>if (!$email)
alert_close('Địa chỉ Mail đã xảy ra lỗi.');</p>
<p>$sql = " select count(*) as cnt from {$g5['member_table']} where mb_email = '$email' ";
$row = sql_fetch($sql);
if ($row['cnt'] > 1)
alert('Tồn tại hơn 2 địa chỉ mail giống nhau. \\n\\nVui lòng liên hệ quản trị viên.');</p>
<p>$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g5['member_table']} where mb_email = '$email' ";
$mb = sql_fetch($sql);
if (!$mb['mb_id'])
alert('Thông tin thành viên không tồn tại.');
else if (is_admin($mb['mb_id']))
alert('관리자 아이디는 접근 불가합니다.');</p>
<p>// 임시비밀Số 발급
$change_password = rand(100000, 999999);
$mb_lost_certify = get_encrypt_string($change_password);</p>
<p>// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
$mb_nonce = md5(pack('V*', rand(), rand(), rand(), rand()));</p>
<p>// 임시비밀Số와 난수를 mb_lost_certify 필드에 저장
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);</p>
<p>// 인증 링크 생성
$href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&mb_nonce='.$mb_nonce;</p>
<p>$subject = "[".$config['cf_title']."] Đây là mail hướng dẫn xác nhận thông tin tài khoản";</p>
<p>ob_start();
include_once ($misc_skin_path.'/password_lost_mail.php');
$content = ob_get_contents();
ob_end_clean();</p>
<p>mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb['mb_email'], $subject, $content, 1);</p>
<p>alert_close($email.' Mail xác nhận ID và mật khẩu đã được gửi về email thành công.\\n\\nVui lòng xác nhận mail để tiếp tục.');
?>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
산타클루스
6년 전
$email = '본인메일' // ex ) test@naver.com
이런식으로 본인메일주소를 직접넣어서 한번 보내보세요 여기까지만 소스로는 알기가어렵네요..
DB에 메일주소가 정확히 들어가있나요?
php에서 mail( $to, $subject, $message ); 이런식으로 보낸다면...
오류날 이유는 메일이 잘못된 경우밖에없을거같은데요..
이런식으로 본인메일주소를 직접넣어서 한번 보내보세요 여기까지만 소스로는 알기가어렵네요..
DB에 메일주소가 정확히 들어가있나요?
php에서 mail( $to, $subject, $message ); 이런식으로 보낸다면...
오류날 이유는 메일이 잘못된 경우밖에없을거같은데요..
댓글을 작성하려면 로그인이 필요합니다.
Expert
6년 전
/bbs/password_lost2.php 파일 확인후 수정해 주시면 될듯 합니다.
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
답변대기
채택
채택
답변대기
채택
답변대기
답변대기
채택
채택
답변대기
답변대기
채택
채택
답변대기
채택
답변대기
채택
답변대기
채택