drugi plik counter.php
include("conn.php"); $sql = mysqli_query($link, "SELECT id,image,post_date,title,duration,download FROM wp_my_plugin GROUP BY post_date DESC "); while($result = mysqli_fetch_object($sql)): ?> <a border="0" href="counter.php?id=<?php echo $result->id; ?>" class="gals-box MultimediaItem MMID_216667" "> </a> <?php
//1. include the configuration file include("conn.php"); //2. Get the id from the url and store it into a variable $id = mysqli_real_escape_string($link, $_GET['id']); //3. fetch the url and clicks from this banner $clicks = mysqli_fetch_object(mysqli_query($link, "SELECT image,hd,download FROM wp_my_plugin WHERE id=".$id."")); //4. increase clicks with 1 $new_click = $clicks->download+1; //5. update this into the database, check if it was succesfull if(mysqli_query($link, "UPDATE wp_my_plugin SET up_post_date=NOW(),download=".$new_click." WHERE id=".$id."")): //6. redirect to the url else: //6. else write to error log endif;
i nie mam pojęcia jak zrobić do tego stronicowanie .