Duplicate comments after refreshing


I am new to learning PHP and SQL and am trying to implement a comment section on my website,
but if you comment, then refresh the page, the comment is duplicated, does anyone know why?
The live version is on http://alexsgamehub.com/test

code for sending/getting comments:

code for test homepage:


1, post code on the forum or in something that is more long term than you google drive.

Odds are that when you refresh the page, it is submitting the comment again; leading to duplicate posts.


You need to implement PRG.


1 Like