The issue you are facing is caused by the
header instruction you have at the bottom of the script. PHP already started sending the HTML to the client, hence you cannot sent the headers again.
Things are transmitted as follows:
1. Header information
2. Page content
If you move the PHP code at the bottom up to the top of the page the issue should dissapear. I included the sample below that should fix the issue.
$telecaller = (isset($_GET['telecaller'])) ? $_GET['telecaller'] : null;
include 'db.php';
if (isset($_POST['submit'])) {
$con=mysql_query("UPDATE import2 SET telecaller='$_POST[telecaller]' WHERE telecaller='$telecaller'")
or die(mysql_error());
if(!$con){
echo 'can not update';
}else {
header('location:ntelecaller.php');
}
}
?>
<html>
<head>
<title>Edit Record</title>
<script>
</script>
</head>
<body>
<form action="#" method="post">
<input type="hidden" name="id" value="<?php echo $telecaller; ??>"/>
<div>
Name of CIExe. <input type="text" name="telecaller" value="<?php echo $telecaller; ??>"/><br />
<input type="submit" name="submit" value="Submit">
</div>
</form>
</body>
</html>