테스트 사이트 - 개발 중인 베타 버전입니다

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

더블피디 7년 전 조회 2,153

</p>

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

  }

 }

//}

?></p>

<p>                        <!-- 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></p>

<p>                        <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></p>

<p>                        <!-- info --></p>

<p>

 

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

 

Not Found

 

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

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트

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

변경 후 확인

 

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

 

<?=$test;?>

<? echo $test; ?>

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

 

검색 short_open_tag

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

7년 전

php 버젼이 바뀌지는 않으셨나요?

mt_srand() 로 바꿔보시고 그래도 안된다면 php 버젼을 바꿔바야죠 ^^

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

M
7년 전

아 출력에러 같네요.

 <?=$info[0]?>.html

이렇게 바꾸시면 될듯 합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인