MyBB Community Forums

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

Now I know this isn't technically plugin support and discussion etc, but it's PHP. And since plugins are coded in PHP, I thought it would be alright to get some advice here. Smile

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
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:
<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>
<smalltext> Version: 1.12 </smalltext>
<smalltext> Downloads: <?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