Support Forums

Full Version: Download Counter Help Please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.

So I've started working on the download page for dotrb, and I need some help with the PHP. I don't knwo why, but for some reason it's just not working.

Here's my code:
PHP Code:
<?php
if(!file_exists('rbshell.txt')){
  
file_put_contents('rbshell.txt''0');
}
if(
$_GET['click'] == 'rbshell'){
  
file_put_contents('rbshell.txt', ((int) file_get_contents('rbshell.txt')) + 1);
  die;
}
?>

Then for the file I want them to be able to download and count:
PHP Code:
<div id="program">
<
center><img src="images/rbshell1.12.png" alt="rbShell" border="2px #efefef">
<
p></p>
<
titletext><a href="/software/rbshell/Release/rbshell_1.12.zip?click=rbshell"rbShell </a></titletext>
<
smalltextVersion1.12 </smalltext>
<
smalltextDownloads: <?php echo file_get_contents('rbshell.txt'); ?></smalltext>
</div> 

http://dotrb.net/software to check out what I mean. It just doesn't count it for some reason..

Thanks for help. Smile
It is counting fine for me. Maybe there was just some lag on your part of the server whenever you were running this?
It's counting fine for me too.
Ah, I forgot to update the post. Someone else helped me fix it now, so it's working good. Thanks. Smile