I am facing problem in sending data to database. The problem is every time i refresh the page it automatically send the previous data. Can any one help.
if (isset($_POST['Posts'])) {
if (isset($_POST['t']) && isset($_POST['i']) && isset($_POST['P'])) {
$title = $_POST['t'];
$idea = $_POST['i'];
if (!empty($title) && !empty($idea)) {
$query = "INSERT INTO `updates` VALUES ('".mysql_real_escape_string($title)."')";
if ($query_run = mysql_query($query)) { }
else {
echo 'Sorry ,we could\'t register you at this time.Try again later';
}
}
}
}