I have an issue.My previous data is inserting again and again at each time of page reload using PHP and MySQL.I am explaining my code below.
$result = $dbobj->savePincode($newCustomerobj);
if($result == 1)
{
$msg='3';
}
else
{
$msg='2';
}
function messagestatus(st)
{
switch(st)
{
case 1:
{
alert("Data Updated Successfully.");
<?php header("location:localhost/demo/pincode.php"); ?>
break;
}
case 2:
{
alert("This user id already exist..");
break;
}
case 3:
{
alert("Data Saved Successfully");
<?php header("location:localhost/demo/pincode.php"); ?>
break;
}
case 4:
{
alert("Data deleted Successfully");
<?php header("location:localhost/demo/pincode.php"); ?>
break;
}
}
}
messagestatus(<?php echo $msg ?>);
Here i am also adding the header but still when user is reloading the page after first time insert again same is inserting.Please help me.