I have simple form to insert data into a MySQL table. I want user after click submit to go back to index.php I have 2 files index.php and insert.php
insert.php
<?php
$con = mysql_connect("xxxxxx", "xxxxxx", "");
mysql_select_db("foster", $con);
if(isset($_POST['submit']))
{
$ID=$_POST['ID'];
$firstName=$_POST['firstName'];
$lastName=$_POST['lastName'];
$query = mysql_query("insert into customers(ID, firstName, lastName) values ('$ID', '$firstName', '$lastName')");
}
?>
<form action="index.php" method="post">
ID: <input type="text" name="ID"/>
<br/>
First Name: <input type="text" name="firstName"/>
<br/>
Last Name: <input type="text" name="lastName"/>
<br/>
<input name="submit" type="submit" value="INSERT CUSTOMER"/>
</form>
My problem is every time I change action to index.php table not change but if use action="#" is working.