I created form that insert data in database but every time I reload the page the data insert again . I use unset($_POST) to fix it but it don't fix .
How I can make it insert only one time .
<form method="post" class="job">
<input type="text" placeholder=" course name" name="name" class="form-control input-lg">
<input type="text" placeholder=" country " name="country" class="form-control input-lg">
<input type="text" placeholder=" company " name="company" class="form-control input-lg">
<input type="date" placeholder=" start " name="start" class="form-control input-lg">
<input type="date" placeholder=" end " name="end" class="form-control input-lg">
<input type="text" placeholder="link" name="link" class="form-control input-lg">
<button type="submit" class="btn btn-warning btn-lg btn-block" name="addcourse" id="addcourse"> ADD COURSE </button>
</form>
</div>
<div class="col-lg-4"></div>
</div>
<?php
include("connect.php");
if (isset($_POST['addcourse'])){
$name = $_POST["name"];
$country = $_POST["country"];
$company = $_POST["company"];
$link = $_POST["link"];
$start=$_POST["start"];
$end=$_POST["end"];
$newcourse="INSERT INTO courses (name,country,company,start,end,link) VALUES ('$name','$country','$company','$start','$end','$link')";
if(!empty($name)&&!empty($country)&&!empty($company)&&!empty($link)&&!empty($start)&&!empty($end)){
if(mysql_query($newcourse)){
unset($_POST);
echo "<script> alert('insert successful'); </script>";
}
else{ unset($_POST);
echo "<script>alert('error'); </script>";
}}
else { unset($_POST);
echo "<script>alert('fill in all field'); </script>";}
}
?>