Ajax gets nothing back from the php.
- by ShaMun
Jquery i dont have alert and firefox i dont have anything in return. The code was working before, database query have successfull records also. What i am missing???
Jquery ajax.
$.ajax({
type : "POST",
url : "include/add_edit_del.php?model=teksten_display",
data : "oper=search&ids=" + _id ,
dataType: "json",
success : function(msg){
alert(msg);
}
});
PHP
case 'teksten_display':
$id = $_REQUEST['ids'];
$res = $_dclass-_query_sql(
"select a,b,id,wat,c,d from tb1 where id='" . $id . "'" );
$_rows = array();
while ( $rows = mysql_fetch_array ($res) ) { $_rows = $rows; }
//header('Cache-Control: no-cache, must-revalidate');
//header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
echo utf8_encode( json_encode($_rows) ) ;
//echo json_encode($_rows);
//var_dump($_rows);
//print_r ($res);
break;
Firefox response/request header
Date Sat, 24 Apr 2010 22:34:55 GMT
Server Apache/2.2.3 (CentOS)
X-Powered-By PHP/5.1.6
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma no-cache
Content-Length 0
Connection close
Content-Type application/json
Host www.xxxx.be
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.5.9-2.fc12 Firefox/3.5.9
Accept application/json, text/javascript, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With XMLHttpRequest
Referer http://www.xxxx.be/xxxxx
Content-Length 17
Cookie csdb=2; codb=5; csdbb=1; codca=1.4; csdca=3; PHPSESSID=benunvkpecqh3pmd8oep5b55t7; CAKEPHP=3t7hrlc89emvg1hfsc45gs2bl2