아무리 삽질해도 되지 않는 아이디 저장 기능..please help me..
아무리 삽질해도 답이 보이질 않습니다.
고수님들 제발 성공하셧으면 도와 주세요..
뭔가 팁정도의 언급이 빠진듯 한데요.. 될듯하면서도 안되고 미치겟습니다.
파일 변경한건 /bbs/login_check.php
----------------------------------------------------------------------------------
// 3.26
// 아이디 쿠키에 한달간 저장
if ($auto_login) {
// 3.27
// 자동로그인 ---------------------------
// 쿠키 한달간 저장
$key = md5($_SERVER[SERVER_ADDR] . $_SERVER[REMOTE_ADDR] . $_SERVER[HTTP_USER_AGENT] . $mb[mb_password]);
set_cookie('ck_mb_id', $mb[mb_id], 86400 * 31);
set_cookie('ck_auto', $key, 86400 * 31);
// 자동로그인 end ---------------------------
} else {
set_cookie('ck_mb_id', '', 0);
set_cookie('ck_auto', '', 0);
}
if($id_save) {
set_cookie('ck_id_save', $mb[mb_id], time()+2592000);
}else{
set_cookie('ck_id_save', '', 0);
}
----------------------------------------------------------------------
----------------------------------------------------------------------------------
// 3.26
// 아이디 쿠키에 한달간 저장
if ($auto_login) {
// 3.27
// 자동로그인 ---------------------------
// 쿠키 한달간 저장
$key = md5($_SERVER[SERVER_ADDR] . $_SERVER[REMOTE_ADDR] . $_SERVER[HTTP_USER_AGENT] . $mb[mb_password]);
set_cookie('ck_mb_id', $mb[mb_id], 86400 * 31);
set_cookie('ck_auto', $key, 86400 * 31);
// 자동로그인 end ---------------------------
} else {
set_cookie('ck_mb_id', '', 0);
set_cookie('ck_auto', '', 0);
}
if($id_save) {
set_cookie('ck_id_save', $mb[mb_id], time()+2592000);
}else{
set_cookie('ck_id_save', '', 0);
}
----------------------------------------------------------------------
다음으로 롤로님이 가르쳐 준 마지막 아웃 로긴 페이지
다음으로 skin/out_login/basic/out_login_skin1.php를 수정하였습니다.
------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$ck_id_save = get_cookie("ck_id_save");
if ($ck_id_save) {
$ch_id_save_chk = "checked";
} else $ch_id_save = "아이디";
?>
<script type="text/javascript" language=JavaScript>
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f)
{
if (bReset) { if ( f.mb_id.value == '아이디' ) f.mb_id.value = ''; bReset = false; }
document.getElementById("pw1").style.display = "none";
document.getElementById("pw2").style.display = "";
}
</script>
<!-- 로그인 전 외부로그인 시작 -->
<table width="220" border="0" cellpadding="0" cellspacing="0">
<form name="fhead" method="post" action="javascript:fhead_submit(document.fhead);" autocomplete="off">
<input type="hidden" name="url" value="<?=$urlencode?>">
<tr>
<td width="220" height="42" colspan="6" valign="top"><img src="<?=$outlogin_skin_path?>/img/login_top.gif" width="220" height="42"></td>
</tr>
<tr>
<td width="5" height="114" rowspan="5" background="<?=$outlogin_skin_path?>/img/login_left_bg.gif"></td>
<td width="210" height="9" colspan="4"></td>
<td width="5" height="114" rowspan="5" background="<?=$outlogin_skin_path?>/img/login_right_bg.gif"></td>
</tr>
<tr>
<td width="210" colspan="4">
<table width="210" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="141">
<table width="141" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="35" height="23"><img src="<?=$outlogin_skin_path?>/img/login_id.gif" width="35" height="23"></td>
<td width="106" height="23" colspan="2" align="center"><input name="mb_id" type="text" size="12" maxlength="20" required itemname="아이디" onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);' value='<?=$ck_id_save?>'>
</td>
</tr>
<tr>
<td width="35" height="23"><img src="<?=$outlogin_skin_path?>/img/login_pw.gif" width="35" height="23"></td>
<td id=pw1 width="106" height="23" colspan="2" align="center"><input type="text" size="12" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
<td id=pw2 style='display:none;' width="106" height="23" colspan="2" align="center"><input name="mb_password" type="password" size="12" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
</tr>
</table>
</td>
<td width="69" height="46" rowspan="2" align="center"><input type="image" src="<?=$outlogin_skin_path?>/img/login_button.gif" width="52" height="46"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="35" height="28"></td>
<td width="20" height="28" valign="top"><input type="checkbox" name="auto_login" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }"></td>
<td width="86"><img src="<?=$outlogin_skin_path?>/img/login_auto.gif" width="46" height="28"></td>
<td width="69" height="28"><input type='checkbox' id='id_save' name='id_save' <?=$g4[path]/$ch_id_save_chk?>>ID 저장</td>
</tr>
<tr>
<td height="20"></td>
<td height="20" colspan="3">
<a href="javascript:win_password_forget();"><img src="<?=$outlogin_skin_path?>/img/login_pw_find_button.gif" width="90" height="20" border="0"></a>
<a href="<?=$g4[bbs_path]?>/register.php"><img src="<?=$outlogin_skin_path?>/img/login_join_button.gif" width="69" height="20" border="0"></a></td>
</tr>
<tr>
<td width="210" colspan="4"></td>
</tr>
<tr>
<td width="220" height="14" colspan="6"><img src="<?=$outlogin_skin_path?>/img/login_down.gif" width="220" height="14"></td>
</tr>
</form>
</table>
<script language="JavaScript">
function fhead_submit(f)
{
if (!f.mb_id.value)
{
alert("회원아이디를 입력하십시오.");
f.mb_id.focus();
return;
}
if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value)
{
alert("패스워드를 입력하십시오.");
f.mb_password.focus();
return;
}
if (document.getElementById('id_save').checked) {
set_cookie('ck_id_save', f.mb_id.value, 24*30)
}
f.action = "<?=$g4[bbs_path]?>/login_check.php";
f.submit();
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$ck_id_save = get_cookie("ck_id_save");
if ($ck_id_save) {
$ch_id_save_chk = "checked";
} else $ch_id_save = "아이디";
?>
<script type="text/javascript" language=JavaScript>
// 엠파스 로긴 참고
var bReset = true;
function chkReset(f)
{
if (bReset) { if ( f.mb_id.value == '아이디' ) f.mb_id.value = ''; bReset = false; }
document.getElementById("pw1").style.display = "none";
document.getElementById("pw2").style.display = "";
}
</script>
<!-- 로그인 전 외부로그인 시작 -->
<table width="220" border="0" cellpadding="0" cellspacing="0">
<form name="fhead" method="post" action="javascript:fhead_submit(document.fhead);" autocomplete="off">
<input type="hidden" name="url" value="<?=$urlencode?>">
<tr>
<td width="220" height="42" colspan="6" valign="top"><img src="<?=$outlogin_skin_path?>/img/login_top.gif" width="220" height="42"></td>
</tr>
<tr>
<td width="5" height="114" rowspan="5" background="<?=$outlogin_skin_path?>/img/login_left_bg.gif"></td>
<td width="210" height="9" colspan="4"></td>
<td width="5" height="114" rowspan="5" background="<?=$outlogin_skin_path?>/img/login_right_bg.gif"></td>
</tr>
<tr>
<td width="210" colspan="4">
<table width="210" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="141">
<table width="141" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="35" height="23"><img src="<?=$outlogin_skin_path?>/img/login_id.gif" width="35" height="23"></td>
<td width="106" height="23" colspan="2" align="center"><input name="mb_id" type="text" size="12" maxlength="20" required itemname="아이디" onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);' value='<?=$ck_id_save?>'>
</td>
</tr>
<tr>
<td width="35" height="23"><img src="<?=$outlogin_skin_path?>/img/login_pw.gif" width="35" height="23"></td>
<td id=pw1 width="106" height="23" colspan="2" align="center"><input type="text" size="12" maxlength="20" required itemname="패스워드" value='패스워드' onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
<td id=pw2 style='display:none;' width="106" height="23" colspan="2" align="center"><input name="mb_password" type="password" size="12" maxlength="20" itemname="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);'></td>
</tr>
</table>
</td>
<td width="69" height="46" rowspan="2" align="center"><input type="image" src="<?=$outlogin_skin_path?>/img/login_button.gif" width="52" height="46"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="35" height="28"></td>
<td width="20" height="28" valign="top"><input type="checkbox" name="auto_login" value="1" onclick="if (this.checked) { if (confirm('자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n\공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?')) { this.checked = true; } else { this.checked = false; } }"></td>
<td width="86"><img src="<?=$outlogin_skin_path?>/img/login_auto.gif" width="46" height="28"></td>
<td width="69" height="28"><input type='checkbox' id='id_save' name='id_save' <?=$g4[path]/$ch_id_save_chk?>>ID 저장</td>
</tr>
<tr>
<td height="20"></td>
<td height="20" colspan="3">
<a href="javascript:win_password_forget();"><img src="<?=$outlogin_skin_path?>/img/login_pw_find_button.gif" width="90" height="20" border="0"></a>
<a href="<?=$g4[bbs_path]?>/register.php"><img src="<?=$outlogin_skin_path?>/img/login_join_button.gif" width="69" height="20" border="0"></a></td>
</tr>
<tr>
<td width="210" colspan="4"></td>
</tr>
<tr>
<td width="220" height="14" colspan="6"><img src="<?=$outlogin_skin_path?>/img/login_down.gif" width="220" height="14"></td>
</tr>
</form>
</table>
<script language="JavaScript">
function fhead_submit(f)
{
if (!f.mb_id.value)
{
alert("회원아이디를 입력하십시오.");
f.mb_id.focus();
return;
}
if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value)
{
alert("패스워드를 입력하십시오.");
f.mb_password.focus();
return;
}
if (document.getElementById('id_save').checked) {
set_cookie('ck_id_save', f.mb_id.value, 24*30)
}
f.action = "<?=$g4[bbs_path]?>/login_check.php";
f.submit();
}
</script>
<!-- 로그인 전 외부로그인 끝 -->
이게 전부 입니다. ................ 뭔가 다른 수정 사항이 잇을듯 하고요.
여러번 삽질 결과는 get_cookie 이넘이 작동을 안하는 것입니다.
성공하신분들 꼭 좀 도와 주세요..
사이트는 www.jinsilro.com 입니다
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인