Thanks for your reply. I cleaned up the code, and it made it simpler to fix the original problem. There are some concerns i have though and i was hoping that perhaps you could shine some light on them for me.
I am constructing the site in PHP, and the html code that was in the txt file which i attached was just the source code copied from the browser. My PHP code is quite structured, so i am not too sure why the html code sent to the browser would be in such a mess, such as 4 link commands all over the place, </HTML> in the middle of tables, and the other stuff you pointed out. Do you know why it would have compiled like that?