I am trying to make a comment system using only a text file......only porblem is that it adds the new additions to the blog to the bottom of the text file, and ideas on how to get the new comments to the top of the text file?
Ok, so after reading the file and parsing it, display back the entries in reverse order, stopping after 5. If you want to do less reading and parsing, maintain a second file as an index where each record would contain two fields, starting_byte_pos and ending_byte_pos, that costs a tiny bit when adding entries, but should save quite a bit when it comes to displaying them back, the more frequent operation. B-)
ok.......I was actually looking for some coded help cause I still relativly new at this stuff. thank you though I have the framework laid out for the script
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.