The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to install a download counter in my code
larry78723
post Mar 31 2020, 12:47 PM
Post #1


Member
***

Group: Members
Posts: 33
Joined: 5-March 20
Member No.: 27,220



I have a download section in my index.php that I'd like to add a download counter to but have no idea how to accomplish this. The existing code works perfectly but I'd like to know how many times the file is downloaded. Would prefer not to use a database.

CODE

<!--  DOWNLOAD -->
<div id="download" class="stylized">
    <div "myform">
    <div class="container">
        <div class="row">
            <div class="download">
                <br /><br>
                <h1><center>FoxClone Download Page</center></h1>
                   <?php
                    $files = glob('download/*.iso');
                    $file = $files[count($files) -1];
                    $info = pathinfo($file);
                    $filename =  basename($file);
                    $filename = ltrim($filename,'/');
                    $md5file = md5_file($file);
                   ?>

                     <div class="container">
                        <div class="divL">                      
                            <h3>Get the "<?php echo "{$filename}";?>" file (approx. 600MB)</h3>
                        <center>  <a href="<?php echo "/{$file}";?>"><img src="images/button_get-the-app.png" alt=""></a> </center><br />
                            <h3 style="margin-bottom: 0.5rem;">The MD5sum for "<?php echo "{$filename}";?>" is "<?php echo "{$md5file}";?>  


Thanks in advance,
Larry
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 9th July 2020 - 11:09 PM