비밀글 기능을 여분필드로 하려고 하는 중에 php 질문입니다...

if (($mb_id && $mb_id == $member[mb_id]) || $is_admin)
;

else if ($wr_2 == 'secret') {
echo "<table border=0 cellpadding=0 cellspacing=0 width=100% height=200>
<tr>
<td height=100% align=center>비밀글입니다.</td>
</tr>
</table>";
}
?>
=========
게시물내용
========-=




위와 같이
자신이 쓴글이나 관리자면 else if 를 넘어가고 wr_2 에 secret 값이 있으면 echo 부분을 보여주는데요...

비밀글입니다는 보여주는데 게시물내용까지 보여주더군요...

"<table border=0 cellpadding=0 cellspacing=0 width=100% height=200>
<tr>
<td height=100% align=center>비밀글입니다.</td>
</tr>
</table>";

위 내용까지만 보여주고 게시물내용부분은 보여주지 안으려면 어떻게 해야하나요?...
|

댓글 1개

<? if ($write[wr_2] == "secret"){ //비밀글이고
if ($is_admin or $write[mb_id] == $member[mb_id]){ //자신이 쓴글이나 관리자라면 ?>

<table width=100% height=200>
<tr align=center>
<td>
<?=$write[content]?>
</td>
</tr>
</table>

<? } else { //자신이 쓴글이나 관리자가 아니라면 ?>

<table width=100% height=200>
<tr align=center>
<td>비밀글입니다.</td>
</tr>
</table>

<? }} else { //비밀글이 아닐때 ?>

<table width=100% height=200>
<tr align=center>
<td>
<?=$write[content]?>
</td>
</tr>
</table>

<? } ?>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고