Insert Data Into Database In PHP MySQL

  1. <?php  
  2. include_once("config.php");  
  3. if(isset($_POST['Submit']))  
  4. {  
  5. $name=$_POST['name'];  
  6. $email=$_POST['email'];  
  7. $result=mysql_query("INSERT INTO store(name,email) VALUES('$name','$email')");  
  8. //header("Location: view.php");  
  9. echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';  
  10. if($result==true)  
  11. {  
  12. ?>  
  13.     <script type="text/javascript">  
  14.         alert('Data success fully stored');  
  15.     </script>  
  16.     <?php  
  17. }  
  18. }  
  19. ?>