Hi, I am currently working on a file based Shoutbox. Instead of using database, I decided to use a file to hold the data. You can preview the shoutbox at: http://animeasylum.3.forumer.com/index.php?act=idx
I am currently working on a feature to edit the posts. I am able to get the data from the file, and display the data. Once the user has edited the post and submitted it. If the length of the updated shout is longer than the strength of the previous shout, the fwrite function goes on to the next line in the file and rewrites other shouts.
My Question. How can I add the updated version of the shout without replacing previous data?
My Solution: I can make do it so that once I have reached the point of the shout data that needs to replaced, I extract the remaining data and store it in the memory space. Then add the newest data and then fwrite the remaining data into the file. I think that may be a little hassle.
So I was wondering if it is possible to fwrite the data, and only limit the boundary to the current line the indicator is on?
Question
hsbsitez
Hi, I am currently working on a file based Shoutbox. Instead of using database, I decided to use a file to hold the data. You can preview the shoutbox at: http://animeasylum.3.forumer.com/index.php?act=idx
I am currently working on a feature to edit the posts. I am able to get the data from the file, and display the data. Once the user has edited the post and submitted it. If the length of the updated shout is longer than the strength of the previous shout, the fwrite function goes on to the next line in the file and rewrites other shouts.
My Question. How can I add the updated version of the shout without replacing previous data?
My Solution: I can make do it so that once I have reached the point of the shout data that needs to replaced, I extract the remaining data and store it in the memory space. Then add the newest data and then fwrite the remaining data into the file. I think that may be a little hassle.
So I was wondering if it is possible to fwrite the data, and only limit the boundary to the current line the indicator is on?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts