WP Insert Post If user refreshes override new post

In wordpress you can do that with so called nonces: WordPress Nonces (Codex)

Add a nonce to your form and when send, check if the nonce is correct. The next time the form get’s submitted, the nonce isn’t correct any longer, so if you check for that you can prevent replaying the data into your system again.

Here you find a step-by-step description and sample code: Improving security in WordPress plugins using Nonces.