Copy
<?php if('/bbs/board.php?bo_table=property16') { // 메인페이지일 때 ?>
<img width="580px" src="/theme/basic/img/business_img1.jpg">
<?php } else { //서브페이지일 때 ?>
<img width="580px" src="/theme/basic/img/business_img2.jpg">
<?php } ?>
if에 있는 url을 확인해서 else일 때 다른 이미지를 보여주게 하고 싶은데요.
어떻게 해야되나요?
|
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
<?php if($bo_table == 'property16') { // property16 게시판 일때
Copy
<?php if($_SERVER['REQUEST_URI'] == '/bbs/board.php?bo_table=property16') { // 메인페이지일 때 ?> <img width="580px" src="/theme/basic/img/business_img1.jpg">
<?php } else { //서브페이지일 때 ?>
<img width="580px" src="/theme/basic/img/business_img2.jpg">
<?php } ?>
답변을 작성하려면 로그인이 필요합니다.