Beginner's advice: How to get the value of Ajax in a PHP program?

Source: Internet
Author: User
1. Discuz plug-in template file:
。。。



      {Loop $listclass $k $v}
    • $v ({echo classnum ($k)})

    • {/loop}


$cid
。。。。

2. How to get the CID value in Qzdn:qzdn_ajax file
(1) $cid = Intval ($_post[' C ');
(2) $cid = Intval ($_g[' Gp_c ');
Both of these ways are not getting ah, where is the reason?


Reply to discussion (solution)

var cx={id: ' Qzdn:qzdn_ajax ', page:page}
DATA:CX,

Get the $_post is such an array
Array (' id ' = ' qzdn:qzdn_ajax ', ' page ' = value of page)

There's no correlation key C, you can't get it, of course.

and

  • $v ({echo classnum ($k)})

  • This is going to use the $_get value.

    1. Do you want to do this?
    var cx={id: ' Qzdn:qzdn_ajax ', page:page,c:cid}
    DATA:CX,

    Use $_post[c] to get the CID value.

    2, and

  • $v ({echo classnum ($k)})

  • This is going to use the $_get value.
    I tried, regardless of the URL of C is how much, with $_get value is 0, I do not know why

    1. Yes
    2, to see what is the value of $appurl

    Multi-use debugging tools. Look at what you sent specifically.
    Firebug Chrome can look at specific AJAX requests.

  • 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.