랜덤으로 정보를 가져오려고 사용했던 코드인데 ...서버 변경 후 안되네요

랜덤으로 정보를 가져오려고 사용했던 코드인데 ...서버 변경 후 안되네요

QA

랜덤으로 정보를 가져오려고 사용했던 코드인데 ...서버 변경 후 안되네요

본문


<?php
//$banner = array(1, 2);
//if (!defined('_INDEX_')) {
 $banner = array();
 while (count($banner) < 2) {
  $index = mt_rand(1, 2);
  if (!in_array($index, $banner)) {
   $info[] = $index;
  }
 }
//}
?>
                        <!-- info -->
                        <div style=" text-align:center; width:500px; margin-top:5px; margin-left:60px; margin-bottom:10px; z-index:999;"  >
                        <iframe src="/info/top<?php=$info[0]?>.html" width="500" height ="90"  scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe>
                        </div>
                        <div style=" text-align:center; width:728px; margin-top:5px; margin-left:60px; margin-bottom:10px; z-index:999;" >
                        <iframe src="/info/top<?=$info[1]?>.html" width="500" height ="90"  scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe>
                        </div>
                        <!-- info -->

 

아래와 같이 나오는데...왜 그럴까여?

 

Not Found

 

The requested URL /info/top< was not found on this server.

이 질문에 댓글 쓰기 :

답변 3

<?php=$info[0]?>.html  ->  <?php echo $info[0]?>.html

변경 후 확인

 

<?=$info[1]?>.html  부분도  확인

 

<?=$test;?>

<? echo $test; ?>

<?php echo $test; ?> <- 권장

 

검색 short_open_tag

답변을 작성하시기 전에 로그인 해주세요.
전체 6
QA 내용 검색
filter #php ×

회원로그인

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