How to use Ajax to achieve praise

Source: Internet
Author: User
How to use Ajax to achieve the likes
Php+mysql implementation of the method is very simple, every click Like, incoming field (Cont_id,cont_type), each time to the database like_count automatically plus 1, but how to use the AJAX implementation of jquery? Ajax jquery PHP

Share to:


------Solution--------------------

$.ajax ({
Type: "Get",
URL: "xxxxxxxxxxxxxx.php",
data:{
Action: "Dianzan", //php identification of AJAX flags (this one does not necessarily add, see PHP file structure
UID: "xxxxxxxxxxx", //Who initiated the praise,
PID: "Xxxxxxxxx", //what element is liked
},
Success:function (msg) {
Receive the information returned by PHP, whether to praise the success, if successful, the foreground JS to make special effects conversion to remind users to praise success If unsuccessful then prompt reason and so on
}
});

------Solution--------------------
Suggest a direct watch video tutorial
Http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2011/0417/7924.html

Look at the bag will
  • 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.