Can you put PHP before the tag like in ASP? If not how does header ("Location: staffdbnew.php"); work as I am always getting an error about headers already being sent.
You need to post the header information at the very top of the page. If it is placed before any HTML code, it should work fine.
If you are using buffering, you can set header information anywhere in the page before you flush the buffer.