관리자는 적용이 안되게하는법
본문
<tr>
<th scope="row"><label for="wr_10">닉네임<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="wr_10" value="<?php echo $member['mb_nick'] ?> " id="wr_10" required class="frm_input required" size="50" maxlength="100">
</td>
</tr>
이렇게 필드를 만들었는데요...
관리자는 value="<?php echo $member['mb_nick'] ?> 값이 적용이 안되게 하려면 어떡해해야하나요?
아시는분계시면 알려주시면 감사하겠습니다....
답변 2
<?php
if($is_admin) {
$nick = "";
} else {
$nick = $member[mb_nick];
}
?>
<tr>
<th scope="row"><label for="wr_10">닉네임<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="wr_10" value="<?php echo $nick ?> " id="wr_10" required class="frm_input required" size="50" maxlength="100"></td>
</tr>
<?if(!$is_admin)?>
<tr>
<th scope="row"><label for="wr_10">닉네임<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="wr_10" value="<?php echo $member['mb_nick'] ?> " id="wr_10" required class="frm_input required" size="50" maxlength="100"></td>
</tr>
<?}?>
이렇게 if문 하나 넣으시면 될거에요 ~