테스트 사이트 - 개발 중인 베타 버전입니다

관리자만 a href 태그가 작동하게 하고 싶습니다.

· 12년 전 · 1138 · 5
[code]
<tr>
<td width="20" align="right"><img src="<?=$connect_skin_path?>/img/icon.gif" width="14" height="14"></td>
<td width="170">&nbsp;&nbsp;<a href='<?=$g4['bbs_path']?>/current_connect.php'><strong>동접</strong>: <?=$row['total_cnt']?>명</a></td>
</tr>
[/code]

해당 소스코드에서 a href = current_connect.php 를 관리자일 경우만 되게 하고싶습니다. 관리자가 아니라면 그냥 동접만 표시하게요..

댓글 작성

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

로그인하기

댓글 5개

<? if($is_admin == 'super'){ ?>

링크걸린 내용

<? } else {?>

링크없는 내용

<? } ?>


이렇게요?
12년 전
모조키님 답변이 맞습니다. 바로 붙여넣으실려면

<tr>
<td width="20" align="right"><img src="<?=$connect_skin_path?>/img/icon.gif" width="14" height="14"></td>
<td width="170">&nbsp;&nbsp;
<? if($is_admin == 'super'){ ?>
<a href='<?=$g4['bbs_path']?>/current_connect.php'>
<? } else {?>
<strong>동접</strong>: <?=$row['total_cnt']?>명</a></td>
</tr>
<? } ?>

이렇게 되나...^^
안되네요..
위에서 링크가 빠졌네요.

<? if($is_admin == 'super'){ ?>
<a href='<?=$g4['bbs_path']?>/current_connect.php'><strong>동접</strong>: <?=$row['total_cnt']?>명</a>
<? } else {?>
<strong>동접</strong>: <?=$row['total_cnt']?>명</a></td>
</tr>
<? } ?>
이것도 안됩니다..

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440