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

ajax 500 Internal Server Error 질문드려요. 채택완료

비누거품 9년 전 조회 11,816

</strong></p><p><strong><script type="text/javascript"></strong></p><p><strong> 
function kin() { 
 </strong></p><p><strong>var kobj = document.getElementById("wr_1").value;</strong></p><p><strong>    var subject = "";
    var content = "";
    $.ajax({
        url: "<?=$board_skin_path?>/ajax_re.php",
        type: "POST",
        data: {
            "subject": kobj,
            "content": kobj
        },
        dataType: "json",
        async: false,
        cache: false,
        success: function(data, textStatus) {
            subject = data.subject;
            content = data.content;
        }
    });</strong></p><p><strong> }
</SCRIPT> </strong></p><p><strong>

 

ajax_re.php

</strong></p><p><strong><? </strong></p><p><strong>$subject = $_POST['subject'];
$content = $_POST['content'];</strong></p><strong><p>
   $max_wr1 =sql_fetch("select max(wr_1) as m1 from g4_write_corporation_car_log");</p><p> </p><p>   $result =sql_query("select * from g4_write_corporation_car_log where (wr_1 between '$subject' and '$max_wr1[m1]') order by wr_1 asc"); 
                   
  for ($i=0; $wow=mysql_fetch_array($result); $i++) { 
  
    $row[$i] = $wow[wr_3];
      }
$out .= $row[0]."<BR/>";   
$out1 .= $row[0]."<BR/>";   
die("{\"subject\":\"$out\",\"content\":\"$out1\"}");
?> </p></strong><p><strong>

 

var kobj = document.getElementById("wr_1").value; 자료 값은 20160601 00:00:00 형태.

 

파이어버그에서는

 

http://192.168.0.3/skin/board/corporation_car_log/ajax_re.php">http://192.168.0.3/skin/board/corporation_car_log/ajax_re.php 

500 Internal Server Error

 

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

답변 3개

채택된 답변
+20 포인트

ajax_re.php

상단에 common.php 파일을 불러오셔야 db 접속이 되실듯  

참고파일

/bbs/ajax.~~~~~.php 파일들. 

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

답변에 대한 댓글 2개

비누거품
9년 전
감사합니다.. 이제 되네요..
변절자
8년 전
ajax_re.php는 어디있는건가요 저도 500에러 뜨는데;;

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

9년 전

ajax_re.php 파일에서

sql_fech 와 sql_query는 함수입니다.

common.php파일 포함시켜야됩니다.

그래도 안되시면 제일 위줄부터 주석처리하면서 에러 라인 잡으세여

 

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

답변에 대한 댓글 1개

비누거품
9년 전
감사합니다. 파이어버그 알려주셔서 수월하게 작업 진행했네요.. 고맙습니다.

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

500 에러는 서버 내부에러입니다.

즉 php 에러가 났는데, 에러메시지를 뿌릴 수 없는 환경이라 Apache에서 http status code를 내뱉는거죠.

 

php에서 display_errors 를 On으로 설정해보세요

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

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

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

로그인