Don't know much about PHP, but it does appear you are sending "<body>"
twice, once in line 2 and once in line 7. The one in line 2 should be
deleted so the "<head>" section of the page comes first. Or you need to
rearrange the order of your statements.