if문 url 확인하는 방법 부탁드립니다.
본문
<?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
<?php if($bo_table == 'property16') { // property16 게시판 일때
<?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 } ?>
답변을 작성하시기 전에 로그인 해주세요.