Copy
<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
Copy
<? $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 | |
|
답변 3개 / 댓글 3개
채택된 답변
+20 포인트
불량학생™
9년 전
ajax_re.php
상단에 common.php 파일을 불러오셔야 db 접속이 되실듯
참고파일
/bbs/ajax.~~~~~.php 파일들.
답변에 대한 댓글 2개
9년 전
ajax_re.php 파일에서
sql_fech 와 sql_query는 함수입니다.
common.php파일 포함시켜야됩니다.
그래도 안되시면 제일 위줄부터 주석처리하면서 에러 라인 잡으세여
답변에 대한 댓글 1개
라면인가봐
9년 전
500 에러는 서버 내부에러입니다.
즉 php 에러가 났는데, 에러메시지를 뿌릴 수 없는 환경이라 Apache에서 http status code를 내뱉는거죠.
php에서 display_errors 를 On으로 설정해보세요
답변을 작성하려면 로그인이 필요합니다.