Ajax coding about problems, Hero help!

Source: Internet
Author: User
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]));
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.