Lorem Ipsum
Member
- Pronoun
- x
I've coded a pretty simple PHP guestbook, which can be found here, and there is one minor error with it.
It doesn't particularly matter, but for organisation, it is good to have. The fopen function is in mode 'a+', which makes the posts go from first ever to most recent. But what I ideally want is the most recent at the very top of the page. I have tried to use the mode r+, but that just deletes some of the text in the guestbook.txt file it has been written to and leaves double <hr>s, random brackets and random letters all over the place.
What I'm asking is if there is any way in which you can protect the text which has already been written to guestbook.txt, and make it space forward if I use the mode r+, so I can get the most recent post first?
It doesn't particularly matter, but for organisation, it is good to have. The fopen function is in mode 'a+', which makes the posts go from first ever to most recent. But what I ideally want is the most recent at the very top of the page. I have tried to use the mode r+, but that just deletes some of the text in the guestbook.txt file it has been written to and leaves double <hr>s, random brackets and random letters all over the place.
What I'm asking is if there is any way in which you can protect the text which has already been written to guestbook.txt, and make it space forward if I use the mode r+, so I can get the most recent post first?