Balderick Posted January 31, 2017 Share Posted January 31, 2017 <?php if (empty($count)) { $count=''; } if ($count == '') { $count ='1'; } else { $count++ ; } echo $count; echo '<br>'; ?> My goal is to make a script that increments $count ever time someone downloads the page. Can this be done without 'storing' the $count value? Or should I create a script with fwrite/fopen or $_SESSION? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 31, 2017 Share Posted January 31, 2017 If you want it to be persistent with all users then you need persistent storage, either a file or a database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now