if문 url 확인하는 방법 부탁드립니다.

if문 url 확인하는 방법 부탁드립니다.

QA

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 } ?>
답변을 작성하시기 전에 로그인 해주세요.
전체 196
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT