I am very new with all of this and just can't figure out the problem. it didnt start until i added that part in the code. When i refresh, more data gets posted also. I'm just not sure what i'm doing wrong.

Do you get a prompt about resending data (when you refresh)? If yes that'll be why more data gets posted - your code is processing the form again and inserting the data again, seeing it as a new submission.

Do you get a prompt about resending data (when you refresh)? If yes that'll be why more data gets posted - your code is processing the form again and inserting the data again, seeing it as a new submission.