Facebook Style Like Unlike using PHP jQuery

This tutorial has an example code for doing like unlike which we have seen in many websites like Facebook. We are using jQuery AJAX to call PHP for updating likes count in the database. We are using the IP address of the visitors to compute the like or unlike status.

jQuery Call for Like Unlike Update

This function will be called on the click event of like, unlike thumb icons. This will execute PHP code via AJAX and update database based on the requested action. On receiving successful AJAX response, this function will update the likes status and count. The script is,