Php mysql jquery file download counter

Php mysql jquery file download counter

php mysql jquery file download counter

No database is required – as the chat will store itself in a simple text file. of jQuery's AJAX abilities, and do their communicating with a PHP file called taniaarraindegia.esy.es $log['text'] = false; } else { $text= array(); $log['state'] = $state + count($lines) Note: Remember this is PHP powered, so you can't just download the files and. Open the file that is keeping count so we can write to it Download Now! The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops, and other. Not bad, although this would be more efficiant using a database and MySQL, as well as having something like taniaarraindegia.esy.es?file=taniaarraindegia.esy.es php mysql jquery file download counter

Absolutely: Php mysql jquery file download counter

PRE KEYED FOOTAGE FREE DOWNLOAD FOR IMOVIE A power mirror for pc download
DOWNLOAD PROPELLERHEAD REASON 9 TORRENT More life album download free mp3 mega
HOW TO DOWNLOAD MODS FOR OPENMW How to download samsung version update

Facebook Style Like Unlike using PHP jQuery

Last modified on September 10th,

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.

View DemoDownload

Database Results to Like Unlike

This code is for listing database results with like unlike icons based on the likes status.

<table class="demo-table"> <tbody> <tr> <th><strong>Tutorials</strong></th> </tr> <?php if(!empty($result)) { $ip_address = $_SERVER['REMOTE_ADDR']; foreach ($result as $tutorial) { ?> <tr> <td valign="top"> <div class="feed_title"><?php echo $tutorial["title"]; ?></div> <div id="tutorial-<?php echo $tutorial["id"]; ?>"> <input type="hidden" id="likes-<?php echo $tutorial["id"]; ?>" value="<?php echo $tutorial["likes"]; ?>"> <?php $query ="SELECT * FROM ipaddress_likes_map WHERE tutorial_id = '" . $tutorial["id"] . "' and ip_address = '" . $ip_address . "'"; $count = $db_handle->numRows($query); $str_like = "like"; if(!empty($count)) { $str_like = "unlike"; } ?> <div class="btn-likes"><input type="button" title="<?php echo ucwords($str_like); ?>" class="<?php echo $str_like; ?>" onClick="addLikes(<?php echo $tutorial["id"]; ?>,'<?php echo $str_like; ?>')" /></div> <div class="label-likes"><?php if(!empty($tutorial["likes"])) { echo $tutorial["likes"] . " Like(s)"; } ?></div> </div> <div class="desc"><?php echo $tutorial["description"]; ?></div> </td> </tr> <?php } } ?> </tbody> </table>

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,

PHP MySQL Like Unlike Update Query Handling

This PHP code receives action from the AJAX call and performs database likes update based on this action. The code is,

<?php if(!empty($_POST["id"])) { require_once("taniaarraindegia.esy.es"); $db_handle = new DBController(); switch($_POST["action"]){ case "like": $query = "INSERT INTO ipaddress_likes_map (ip_address,tutorial_id) VALUES ('" . $_SERVER['REMOTE_ADDR'] . "','" . $_POST["id"] . "')"; $result = $db_handle->insertQuery($query); if(!empty($result)) { $query ="UPDATE tutorial SET likes = likes + 1 WHERE id='" . $_POST["id"] . "'"; $result = $db_handle->updateQuery($query); } break; case "unlike": $query = "DELETE FROM ipaddress_likes_map WHERE ip_address = '" . $_SERVER['REMOTE_ADDR'] . "' and tutorial_id = '" . $_POST["id"] . "'"; $result = $db_handle->deleteQuery($query); if(!empty($result)) { $query ="UPDATE tutorial SET likes = likes - 1 WHERE id='" . $_POST["id"] . "' and likes > 0"; $result = $db_handle->updateQuery($query); } break; } } ?>

View DemoDownload

&#; Back to Top

Источник: [taniaarraindegia.esy.es]

Php mysql jquery file download counter

1 thoughts to “Php mysql jquery file download counter”

Leave a Reply

Your email address will not be published. Required fields are marked *