OK, I have no idea how to do this. Basically I want to design a rating system for an image gallery I made and finally works.
Basically, in a file called preview.php, I need to display:
Rating: <?php echo $rating; ?>%
Rate It: ()1 ()2 ()3 ()4 ()5 [ Submit ] <- Submits to rate.php
()=radio button
Actually, that would probably be modified to a different form. But what I need is to save their rating into a flatfile (ratings.txt) and then for preview.php to display an average of all the ratings.
I haven't the slightest idea how to do this without a DB (which I don't have). I realize how to add to a flatfile via fopen, fwrite, fclose, but how do I read the contents and then average them?