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

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

QA

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

답변 3

본문


<?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

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 12,369
© SIRSOFT
현재 페이지 제일 처음으로