# How do i avoid send data when i reload ?

**URL:** <https://www.phphelp.com/t/how-do-i-avoid-send-data-when-i-reload/19641>\
**Category:** General PHP Help\
**Created:** [February 18, 2013, 2:56pm UTC](https://www.phphelp.com/t/how-do-i-avoid-send-data-when-i-reload/19641 "2013-02-18T14:56:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://www.phphelp.com/uploads/default/original/2X/2/243e9ed5d93c5653ce3186f18df16e019ce38445.png) [@system](https://www.phphelp.com/u/system)\
**Post date:** [February 18, 2013, 2:56pm UTC](https://www.phphelp.com/t/how-do-i-avoid-send-data-when-i-reload/19641/1 "2013-02-18T14:56:23Z")

</div>

I want to send a data from my page called is index.php, the action is with same page, so i can get $\_POST[‘submit’] in index.php, when i submit data is save succesfully to my database, but when i reload the page data still save to my database. my question is how do i avoid send data when i reload it ?

Thanks…  
my php code …  
[php]

\<?php $name = $\_POST['name'] ; $email = $\_POST['email'] ; $website = $\_POST['website'] ; $comment = $\_POST['comment'] ; if(isset($\_POST['submit'])){ $message = "" ; $SQL = "INSERT INTO comments (name, email, website, comment\_text ) VALUES ('$name', '$email', '$website', '$comment' )" ; $result = mysql\_query($SQL) ; $message = "Your Comment was successfully sent." ; } else { $message = "fail" ; } ?\>

[/php]
