Not redirecting to new page

when submit is pressed should update then go to index page. but just getting blank page but it is updating
cheers
Doug

<body>
 <?
  
   $dbh=mysql_connect("localhost", "xxxx", "xxxxx") or die('I cannot connect to database because: ' .mysql_error()) ; 
        mysql_select_db("xxxxx"); 
  if($_POST['Submit']){  
  // Get parameters from form. 
  $id=$_POST['id']; 
  $item=$_POST['item'];  
  mysql_query("update products set item='$item' where id='$id'"); 
	header('location: index.php');
	 exit; 
	 } 
	   $id=$_GET['id'];  
	  
	   $result=mysql_query("select * from products where id='$id'");  
	  
	   $row=mysql_fetch_assoc($result);
	
	   mysql_close(); 
	   ?>  
       <!-- END OF PHP CODES AND START HTML TAGS -->  
<html> 
<body> 
       <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> 
       <form id="form1" name="form1" method="post" action="<? echo $PHP_SELF; ?>"> 
       <input type="hidden" name="id" value="<?php echo $row['id']; ?>" /> 
       <p>Item :
         <input name="item" type="text"size="100" id="item" value="<? echo $row['item']; ?>"/> 
         <br />  
       <p> <input type="submit" name="Submit" value="Submit" /> </p> 
       </form> 
</body>
</html>

You can’t use header before you’ve output information.

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

Are you outputting information before the start of your <body> tag?

Error messages are very helpful when you’re writing code, because they often bring your attention to problems. You need to identify a problem before you can hope to fix it, and verbose error reporting can help with that. You should always configure php to show you errors while you’re developing and testing the code, although you shouldn’t display the errors on a live site.

Edit your php.ini file and set
display_errors = On
error_reporting = E_ALL | E_STRICT

Then restart your webserver. php should be very verbose now. Some of the messages aren’t due to serious issues, but they often reveal questionable parts of your code, which should probably be improved.

is $id a number?

all sorted now
thnaks to all
Doug