I found this error message on the server:
[21-Feb-2013 18:49:08] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/foresttr/public_html/MI/tblnames_insert.php:2) in /home/foresttr/public_html/MI/tblnames_insert.php on line 32
Putting <? ob_start(); ?> and <? ob_flush(); ?> at the begining and end of the page gets it working as required - but I'm not sure if this is the best solution?.
This does explain why the problem did not occur on my test (WAMP) server, it only started when I uploaded the files to my live server.