A problem with my simple comment system
Posted: Sat Oct 03, 2009 6:55 am
Hi guys
I made this simple comment system, where people could just write in their name and comment and leave a message that everyone can see.
I've got a form set up with the fields name and comment, and I have a text file to store all the past comments (not database!).
Anyway, my program opens this txt file with fopen() append, and writes to it with fputs(). The only problem is, whenever people refresh the page after they left the comment, the browser sends the typed info again to the form, and the comment appear again. Can you do something to prevent this? I'll appreciate any help.
thanks
I made this simple comment system, where people could just write in their name and comment and leave a message that everyone can see.
I've got a form set up with the fields name and comment, and I have a text file to store all the past comments (not database!).
Anyway, my program opens this txt file with fopen() append, and writes to it with fputs(). The only problem is, whenever people refresh the page after they left the comment, the browser sends the typed info again to the form, and the comment appear again. Can you do something to prevent this? I'll appreciate any help.
thanks