로그인 하면 로그아웃이 나오게 하고싶은데.. 채택완료
로그인 스킨을 사용하지 않고 상단에 아래와 같은 소스를 넣어서 링크 하고 있습니다.
홈으로 로그인 회원가입
</strong></p>
<p><div class="top-contact pull-right">
<a href="main.php" class="hyper"><i class="fa fa-home"></i> 홈으로</a>
<a href="login.php" class="hyper"><i class="fa fa-sign-in"></i> 로그인</a>
<a href="register.php" class="hyper"><i class="fa fa-unlock" aria-hidden="true"></i> 회원가입</a>
</div></p>
<p><strong>
위에 소스를 로그인 한 경우에
홈으로 로그아웃 정보수정
이렇게 나오게 할려면 소스를 어찌 수정 해야 할까요?
로그인 하기전과 로그인후 멤버 일때 구문으로 나누어서 넣어 줘야 할거같은데..
아시는 분 답변 좀 부탁 드리겠습니다. ^^*
답변 2개
</p>
<p><div class="top-contact pull-right"></p>
<p><a href="main.php" class="hyper"><i class="fa fa-home"></i> 홈으로</a></p>
<p><?php if ($is_member) { ?></p>
<p><a href="login.php" class="hyper"><i class="fa fa-sign-in"></i> 로그인</a>
<a href="register.php" class="hyper"><i class="fa fa-unlock" aria-hidden="true"></i> 회원가입</a></p>
<p><?php if ($is_admin) { ?>
<a href="<?php echo G5_ADMIN_URL ?>"><b><i class="fa fa-user-circle" aria-hidden="true"></i> 관리자</b></a>
<?php } ?>
<?php } else { ?></p>
<p><a href="logout.php" class="hyper"><i class="fa fa-sign-in"></i> 로그아웃</a>
<a href="info.php" class="hyper"><i class="fa fa-sign-in" ></i> 정보수정</a>
<?php } ?></p>
<p></div></p>
<p>
와 같이 하시면 될 듯 합니다.
댓글을 작성하려면 로그인이 필요합니다.
</p>
<p>if($member['mb_id']) {</p>
<p> <a href="login.php" class="hyper"><i class="fa fa-sign-in"></i> 로그인</a></p>
<p> <a href="register.php" class="hyper"><i class="fa fa-unlock" aria-hidden="true"></i> 회원가입</a></p>
<p>} else { </p>
<p> <a href="logout.php" class="hyper"><i class="fa fa-sign-in"></i> 로그아웃</a></p>
<p> <a href="info.php" class="hyper"><i class="fa fa-sign-in" ></i> 정보수정</a></p>
<p>}</p>
<p>
답변에 대한 댓글 5개
if($member['mb_id']) { ==> <?php if($member['mb_id']) { ?>
} else { ==> <?php } else { ?>
} ==> <?php } ?>
혹시 로그아웃하고 페이지 이동을 원하는 페이지로 이동할려면 어찌 해야 할까요?
지금은 board로 이동하던데
main.php로 이동 시키고 싶은데..
설정이나 이런곳에 있는지는 모르겠네요 ^^
특정 게시판 일 경우(예를 들어 게시판명이 freeboard)
logout.php 파일에서
} else if ($bo_table) {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
} else {
$link = G5_URL;
}
부분을
} else if ($bo_table) {
if($bo_table == "freeboard") {
$link = G5_URL.'/main.php';
} else {
$link = G5_BBS_URL.'/board.php?bo_table='.$bo_table;
}
} else {
$link = G5_URL;
}
로 하면 될구요.
모든 게시판일 경우는
} else if ($bo_table) {
$link = G5_URL.'/main.php';
} else {
$link = G5_URL;
}
로 하면 될 듯 하네요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
죄송한데 이 소스를 어떻게 적용해야 할지 몰라서 다시 한번 여쭤 봅니다.
main.php 파일 상단에 알려주신 소스를 넣었더니
<div class="top-contact pull-right">
<a href="main.php" class="hyper"><i class="fa fa-home"></i> 홈으로</a>
<?php
if($member['mb_id']) {
<a href="login.php" class="hyper"><i class="fa fa-sign-in"></i> 로그인</a>
<a href="register.php" class="hyper"><i class="fa fa-unlock" aria-hidden="true"></i> 회원가입</a>
} else {
<a href="logout.php" class="hyper"><i class="fa fa-sign-in"></i> 로그아웃</a>
<a href="info.php" class="hyper"><i class="fa fa-sign-in" ></i> 정보수정</a>
}
?>
</div>
작동이 잘 되지 않아서 그런데..혹시 알려주신 소스 넣으면 상단에 무슨 코드를 더 넣어 줘야 하나요?
지금은 최근글 때문에 아래 소스만 넣어 주었습니다.
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/latest.lib.php')
?>