로그인 상태 유지... 정보
로그인 상태 유지...
본문
로그인 스킨을 안 쓰고 이미지를 따로 사용해서 작성 시켰는데,
다른페이지로 가면 로그인이 풀어져 버리네요 ㅠㅠ
도와주세여~!~!~!~!!~
login.php란 파일로 작성해서
index랑 head파일에 인클루드 시켰습니다.
<?if ($mb_id){?>
<!-- 로그아웃-->
<table width="210" height="141" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4">
<img src="images/logout_01.jpg" width="210" height="35" alt=""></td>
</tr>
<tr>
<td colspan="4" backgound="images/logout_02.jpg" width="210" height="50" align="center">
<b><?=$mb_id;?></b><font color="red"> 님 환영합니다.</font>
</td>
</tr>
<tr>
<td colspan="2">
<img src="images/logout_03.jpg" width="100" height="25" alt=""></td>
<td colspan="2">
<a href="./bbs/logout.php" onFocus="this.blur();"><img src="images/logout_04.jpg" width="110" height="25" alt=""></a></td>
</tr>
<tr>
<td>
<a href="./bbs/member_confirm.php?url=register_form.php" onFocus="this.blur()"><img src="images/logout_05.jpg" width="70" height="30" alt=""></a></td>
<td colspan="2">
<a href="./shop/orderinquiry.php" onFocus="this.blur();"><img src="images/logout_06.jpg" width="55" height="30" alt=""></a></td>
<td>
<a href="./shop/mypage.php" onFocus="this.blur()"><img src="images/logout_07.jpg" width="85" height="30" alt=""></a></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="70" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="30" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="25" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="85" height="1" alt=""></td>
</tr>
</table>
<!-- 로그아웃 End -->
<?}else{?>
<!-- 로그인 -->
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off" style="margin:0px;">
<input type="hidden" name="url" value="<?=$url?>">
<table width="210" height="141" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5">
<img src="../images/login_01.jpg" width="210" height="35" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="../images/login_02.jpg" width="70" height="25" alt=""></td>
<td colspan="3" background="../images/login_03.jpg" width="140" height="25" style="padding:0px 0px 0px 10px">
<input name=mb_id type=text class='box22' required itemname="아이디" value='아이디' onMouseOver='chkReset(this.form);' onFocus='chkReset(this.form);' size="15">
</td>
</tr>
<tr>
<td colspan="2">
<img src="../images/login_04.jpg" width="70" height="25" alt=""></td>
<td colspan="3" background="../images/login_05.jpg" width="140" height="25" style="padding:0px 0px 0px 10px"><input name=password type=text class='box22' itemname="패스워드" value="패스워드" onMouseOver='chkReset(this.form);' onfocus='chkReset(this.form);' onKeyPress="check_capslock(event, 'outlogin_mb_password');" size="15"></td>
</tr>
<tr>
<td>
<img src="../images/login_06.jpg" width="40" height="25" alt=""></td>
<td colspan="2">
<img src="../images/login_07.jpg" width="60" height="25" alt="" ></td>
<td colspan="2">
<!--<img src="../images/login_08.jpg" width="110" height="25" alt="">--><input type="image" style="border:0;" src="../images/login_08.jpg" border='0' width="110" height="25" onFocus="this.blur();"></td>
</tr>
<tr>
<td colspan="2">
<a href="./bbs/register.php" onFocus="this.blur();"><img src="../images/login_09.jpg" width="70" height="30" alt=""></a></td>
<td colspan="2">
<a href="javascript:win_password_forget();" onFocus="this.blur();"><img src="../images/login_10.jpg" width="55" height="30" alt=""></a></td>
<td>
<a href="javascript:win_password_forget();" onFocus="this.blur();"><img src="../images/login_11.jpg" width="85" height="30" alt=""></a></td>
</tr>
<tr>
<td>
<img src="../images/spacer.gif" width="40" height="1" alt=""></td>
<td>
<img src="../images/spacer.gif" width="30" height="1" alt=""></td>
<td>
<img src="../images/spacer.gif" width="30" height="1" alt=""></td>
<td>
<img src="../images/spacer.gif" width="25" height="1" alt=""></td>
<td>
<img src="../images/spacer.gif" width="85" height="1" alt=""></td>
</tr>
</table>
<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<script type="text/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>
<script language="JavaScript">
function fhead_submit(f)
{
if (!f.mb_id.value) {
alert("회원아이디를 입력하십시오.");
f.mb_id.focus();
return false;
}
if (document.getElementById('pw2').style.display!='none' && !f.mb_password.value) {
alert("패스워드를 입력하십시오.");
f.mb_password.focus();
return false;
}
<?
if ($g4[https_url])
echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
else
echo "f.action = '$g4[bbs_path]/login_check.php';";
?>
return true;
}
</script>
</form>
<!-- 로그인 End -->
<?}?>
댓글 전체
$g4['cookie_domain'] = "";
을 .sir.co.kr 같이 입력하세요
2. <?if ($mb_id){?> 변수가 먹통일수도 있습니다.
<?if ($member[mb_id]){?> 바꿔보시구요...

추가 시켜줬구요, head, index파일에도 있습니다.
($member[mb_id]) 로 하니까 안불러오네요 ㅡㅡ;
음..,
일단 지금상태로 하면 로그인이 한번은 되고 세션도 잘 생성 됩니다.
근데, 그상태에서 새로고침을하면 로그인이 되있는데,
똑같은 주소를 그대로 써서 넣거나, 다른페이지로 넘어가면 로그인이 풀리네요ㅠ
index.php랑 head.php 빼고는 로그인 관련된 다른 페이지는 전혀 손댄곳이 없는데..
혹시 영카트를 쓰고 있는게 이유가 될 수 있나여..?