How to use ajax to implement likes in php + mysql is very simple. every time you click likes, input the field (cont_id, cont_type) and add 1 to like_count in the database each time, but how can we use ajax in jquery to implement it?
Reply to discussion (solution)
$. Ajax ({type: "get", url: "xxxxxxxxxxxxxx. php ", data: {action:" dianzan ", // php identifies ajax signs (this one does not have to be added. check the php file structure uid:" xxxxxxxxxxx ", // who initiated likes, pid: "xxxxxxxxx", // what elements are likes}, success: function (msg) {// receives the information returned by PHP, whether the likes are successful, if yes, the foreground JS will convert the special effects to remind the user of successful thumb ups. if not, the reason will be prompted }});
We recommend that you directly view the video tutorial.
Http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2011/0417/7924.html
I saw the meeting
Both the upstairs are good people.
Did the landlord make it? Can you give me specific code reference?