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

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

QA

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

답변 2

본문


<?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 } ?>
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로