Solar Posted July 11, 2009 Share Posted July 11, 2009 Okay, This may be a difficult question and I've tried many times and cannot succeed. What I want to do is when a user clicks on a button on my site, they will get credited for.. So.. In order for the points to add up by 1 each time, I want to use the Filesystem Functions. <?php $handle = fopen("c:\\data\\filehere.txt", "r"); ?> For example; Say Steven has 32 points. When he clicks that button, he will then get 33 points. How can I make sure that when using Filesystem Functions calculate the total before and add 1 onto it after? Thanks in advanced! Steven Quote Link to comment https://forums.phpfreaks.com/topic/165602-solved-using-filesystem-functions/ Share on other sites More sharing options...
ignace Posted July 11, 2009 Share Posted July 11, 2009 $total = (int) file_get_contents('c:\\data\\filehere.txt'); file_put_contents('c:\\data\\filehere.txt', ++$total); Quote Link to comment https://forums.phpfreaks.com/topic/165602-solved-using-filesystem-functions/#findComment-873477 Share on other sites More sharing options...
Solar Posted July 11, 2009 Author Share Posted July 11, 2009 Thank you so much! Such a great help! Quote Link to comment https://forums.phpfreaks.com/topic/165602-solved-using-filesystem-functions/#findComment-873778 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.