sir when i am inserting values from form to database table it is fine but when i click on refresh or refresh with F5 button than values are again inserting in the table and i should tell you i also used this code :-
if (isset($_POST['submit'])){
}
so tell me how can i solve this problem. and i how can i prevent duplicate record insertion while refresh the php page?
My coding is this coding is for register.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tools Shop</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/boxOver.js"></script>
</head>
<body>
<div id="main_container">
<?php
include "includes/header.php";
?>
<?php
include "includes/left.php";
?>
<div class="center_content">
<form action="" method="post">
Name<span style="color:red;"></span> <input type="text" name="name" placeholder="Name" style="margin-left:39px;" /><br /><br />
Email<span style="color:red;"></span> <input type="text" name="email" placeholder="Email" style="margin-left:42px;" /><br /><br />
Password<span style="color:red;"></span> <input type="text" name="password" placeholder="Password" /><br /><br />
Contact<span style="color:red;"></span> <input type="text" name="contact" placeholder="Contact No." style="margin-left:30px;" /><br /><br />
Address<span style="color:red;">*</span> <input type="text" name="address" placeholder="Address" style="margin-left:28px;" /><br /><br />
Gender :
<input type="radio" checked="checked" name="gender" value="Male" />Male
<input type="radio" checked="checked" name="gender" value="Female" />Female<br /><br />
<input type="submit" value="submit" name="submit" style="margin-left:70px;"/>
</form>
<?php
if (isset($_POST['submit'])){
$name= $POST['name'];
$email= $POST['email'];
$password= $POST['password'];
$contact= $POST['contact'];
$address= $POST['address'];
$gender=$POST['gender'];
$mysqli->query("INSERT INTO members (name,email,password,contact,address,gender)
VALUES('$name','$email','$password','$contact','$address','$gender')");
echo "<h2>Successfully Registered</h2>";
}
?>
</div>
<!-- end of center content -->
<?php
include "includes/right.php";
?>
<!-- end of right content -->
</div>
<!-- end of main content -->
<?php
include "includes/footer.php";
?>
<!-- end of main_container -->
</body>
</html>