$headline = $POST['headline'];
$newsBody = $POST['newsbody'];
$schoolID = $_COOKIE['status'];
$query = "INSERT INTO bulletinBoard
(bulletID,schoolID,bulletTitle,bulletBody)
VALUES ('','$schoolID','$headline','$newsBody')";
if($_POST['headline'] != NULL && $_POST['newsbody'] != NULL)
{
$result = mysql_query($query) or die(mysql_error());
echo("News Posted");
}
$identifier = $_GET['id'];
if($_GET['id'] != NULL)
{
$query2 = "SELECT *
FROM bulletinBoard
WHERE bulletID = '$identifier'";
$result2 = mysql_query($query2) or die(mysql_error());
$data = mysql_fetch_array($result2)or die(mysql_error());
}
?>
what's wrong with the code above? when i post a message it would store the values in the database as expected but im having problems if after i submit the values and i press refresh it would store again the same value in the database on again and again every time i press the refresh button without leaving on another page... im still starting out with php im still having difficulties going around it