비밀번호 찾기에 오류가 나서 문의드립니다. 채택완료
안녕하세요? 좋은 아침입니다.
bbs/password_lost.php에서 이메일을 입력하고 비밀번호 찾기를 하면 새창(bbs/password_lost2.php)이 뜨고 "웹 사이트에서 페이지를 표시할 수 없습니다."가 출력됩니다.
bbs/password_lost2.php 파일은 아래와 같이 분명 존재하고 파일권한도 이상이 없는데 왜 웹 사이트에서 페이지를 표시할 수 없다고 하는지 알수가 없습니다.
bbs/password_lost.php
if ($is_member) { alert("You are already signed in."); }
$g5['title'] = 'Find Member Information'; include_once(G5_PATH.'/head.sub.php');
$action_url = G5_HTTPS_BBS_URL."/password_lost2.php"; include_once($member_skin_path.'/password_lost.skin.php');
include_once(G5_PATH.'/tail.sub.php'); ?>
-----bbs/password_lost.2php---------------------
if ($is_member) { alert('You are already signed in.'); }
if (!chk_captcha()) { alert('Prevent auto enrollment The number is incorrect.'); }
$email = trim($_POST['mb_email']);
if (!$email) alert_close('Email address error.');
$sql = " select count(*) as cnt from {$g5['member_table']} where mb_email = '$email' "; $row = sql_fetch($sql); if ($row['cnt'] > 1) alert('More than one email address exists.\\n\\nPlease contact the administrator.');
$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('It does not exist.'); else if (is_admin($mb['mb_id'])) alert('The administrator ID is inaccessible.');
// 임시비밀번호 발급 $change_password = rand(100000, 999999); $mb_lost_certify = get_encrypt_string($change_password);
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용 $mb_nonce = md5(pack('V*', rand(), rand(), rand(), rand()));
// 임시비밀번호와 난수를 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);
// 인증 링크 생성 $href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&mb_nonce='.$mb_nonce;
$subject = "[".$config['cf_title']."] It is a guide to finding the member information you requested.";
$content = "";
$content .= '
'; $content .= 'Find Member Information'; $content .= '
'; $content .= ''; $content .= ''.$config['cf_title'].''; $content .= ''; $content .= ''; $content .= addslashes($mb['mb_name'])." (".addslashes($mb['mb_nick']).")"." You requested your membership information ".G5_TIME_YMDHIS "; $content .= 'Since our site does not know your password even if you are an administrator, we will generate a new password instead of letting you know your password. '; $content .= 'Please check the password to be changed below, Change Password Click the link. '; $content .= 'When the authentication message that the password has been changed is displayed, enter the member ID and the changed password on the homepage and log in. '; $content .= 'After logging in, please change to the new password in the Edit Information menu.'; $content .= '
'; $content .= ''; $content .= 'Member ID '.$mb['mb_id'].' '; $content .= 'Password to be changed '.$change_password.''; $content .= '
'; $content .= 'Change Password'; $content .= 'mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb['mb_email'], $subject, $content, 1);
alert_close($email.' We have sent you an email to verify your username and password.\\n\\nPlease check your e-mail.'); ?>
답변 1개
password_lost2.php을
아래와 같이 해보세요 ~
</p><p><?php</p><p>include_once('./_common.php');</p><p>include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');</p><p>include_once(G5_LIB_PATH.'/mailer.lib.php');</p><p>if ($is_member) {</p><p> alert('You are already signed in.');</p><p>}</p><p>if (!chk_captcha()) {</p><p> alert('Prevent auto enrollment The number is incorrect.');</p><p>}</p><p>$email = trim($_POST['mb_email']);</p><p>if (!$email)</p><p> alert_close('Email address error.');</p><p>$sql = " select count(*) as cnt from {$g5['member_table']} where mb_email = '$email' ";</p><p>$row = sql_fetch($sql);</p><p>if ($row['cnt'] > 1)</p><p> alert('More than one email address exists.\\n\\nPlease contact the administrator.');</p><p>$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g5['member_table']} where mb_email = '$email' ";</p><p>$mb = sql_fetch($sql);</p><p>if (!$mb['mb_id'])</p><p> alert('It does not exist.');</p><p>else if (is_admin($mb['mb_id']))</p><p> alert('The administrator ID is inaccessible.');</p><p>// 임시비밀번호 발급</p><p>$change_password = rand(100000, 999999);</p><p>$mb_lost_certify = get_encrypt_string($change_password);</p><p>// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용</p><p>$mb_nonce = md5(pack('V*', rand(), rand(), rand(), rand()));</p><p>// 임시비밀번호와 난수를 mb_lost_certify 필드에 저장</p><p>$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";</p><p>sql_query($sql);</p><p>// 인증 링크 생성</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']."] It is a guide to finding the member information you requested.";</p><p>$content = "";</p><p>$content .= '<div style="margin:30px auto;width:600px;border:10px solid #f7f7f7">';</p><p>$content .= '<div style="border:1px solid #dedede">';</p><p>$content .= '<h1 style="padding:30px 30px 0;background:#f7f7f7;color:#555;font-size:1.4em">';</p><p>$content .= 'Find Member Information';</p><p>$content .= '</h1>';</p><p>$content .= '<span style="display:block;padding:10px 30px 30px;background:#f7f7f7;text-align:right">';</p><p>$content .= '<a href="'.G5_URL.'" target="_blank">'.$config['cf_title'].'</a>';</p><p>$content .= '</span>';</p><p>$content .= '<p style="margin:20px 0 0;padding:30px 30px 30px;border-bottom:1px solid #eee;line-height:1.7em">';</p><p>$content .= addslashes($mb['mb_name'])." (".addslashes($mb['mb_nick']).")"." You requested your membership information '".G5_TIME_YMDHIS."'
";</p><p>$content .= 'Since our site does not know your password even if you are an administrator, we will generate a new password instead of letting you know your password.
';</p><p>$content .= 'Please check the password to be changed below, <span style="color:#ff3061"><strong>Change Password</strong> Click the link.</span>
';</p><p>$content .= 'When the authentication message that the password has been changed is displayed, enter the member ID and the changed password on the homepage and log in.
';</p><p>$content .= 'After logging in, please change to the new password in the Edit Information menu.';</p><p>$content .= '</p>';</p><p>$content .= '<p style="margin:0;padding:30px 30px 30px;border-bottom:1px solid #eee;line-height:1.7em">';</p><p>$content .= '<span style="display:inline-block;width:100px">Member ID</span> '.$mb['mb_id'].'
';</p><p>$content .= '<span style="display:inline-block;width:100px">Password to be changed</span> <strong style="color:#ff3061">'.$change_password.'</strong>';</p><p>$content .= '</p>';</p><p>$content .= '<a href="'.$href.'" target="_blank" style="display:block;padding:30px 0;background:#484848;color:#fff;text-decoration:none;text-align:center">Change Password</a>';</p><p>$content .= '</div>';</p><p>$content .= '</div>';</p><p>mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb['mb_email'], $subject, $content, 1);</p><p>alert_close($email.' We have sent you an email to verify your username and password.\\n\\nPlease check your e-mail.');</p><p>?></p><p>
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인