ajax 500 Internal Server Error 질문드려요.

ajax 500 Internal Server Error 질문드려요.

QA

ajax 500 Internal Server Error 질문드려요.

본문


<script type="text/javascript">
 
function kin() { 
 
var kobj = document.getElementById("wr_1").value;
    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;
        }
    });
 }
</SCRIPT> 

 

ajax_re.php


<? 
$subject = $_POST['subject'];
$content = $_POST['content'];

   $max_wr1 =sql_fetch("select max(wr_1) as m1 from g4_write_corporation_car_log");
 
   $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\"}");
?> 

 

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

 

파이어버그에서는

 

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

500 Internal Server Error
 
Parameters
content 20160601 17:38:36
subject 20160601 17:38:36
Source

subject=20160601+17%3A38%3A36&content=20160601+17%3A38%3A36

 

500에러는 구글 검색을 해봐도 도통 답을 찾지를 못하겠네요...

도와 주세요 ㅠ.ㅠ 

 

이 질문에 댓글 쓰기 :

답변 3

ajax_re.php

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

참고파일

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

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

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

 

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

ajax_re.php 파일에서

sql_fech 와 sql_query는 함수입니다.

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

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

 

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

회원로그인

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