Ajax coding problems, such as online heroes Help!!!
Public Function Ajax_page () {
Header (' CONTENT-TYPE:TEXT/HTML;CHARSET=GBK ');
Error_reporting (E_all);
$page = $this->input->post (' pg ');
$where = $this->input->post (' action ');
$array = Explode (' _ ', $where);
$condition [' group_id '] = $array [0];
$condition [' status '] = $array [1];
$condition [' username '] = @iconv ("UTF-8", "GBK", $array [2]);
echo $condition [' username '];
$condition [' display '] = 15;
$condition [' page '] = ($page-1) * 15;
$num = $this->member_model->selcount ($condition);
$url = Base_url (). " /index.php/admin/member_list/";
$this->page->select = $where;
$this->page_model->page ($num, "a", $page, $url);
$data [' page '] = $this->page->pagenav;
$data [' user '] = $this->member_model->selmember ($condition);
$this->load->language (' Admin/member ');
$data [' lang '] = $this->lang->line (' htmllanguages ');
Print_r ($data [' user ']);//exit;
$this->load->view (' Admin/member_list_ajax ', $data);
}
Share to:
------Solution--------------------
The received parameters are tested with UrlDecode decoding
------Solution--------------------
Does your client use jquery?
JQ Ajax is not required to do URL coding yourself
Since you already have where = encodeURIComponent (where); The
Then you need to do it yourself again. URL decoding
$condition [' username '] = iconv ("UTF-8", "GBK", Uredecode ($array [2]));