That article does provide the basics of how it's done. Why don't you post your code so we can fix it.
Essentially, the php script returns javascript, and that javascript includes document.write statements to print out something.
You want to put the script section in the portion of your HTML page that you want it to display rather than in the header.
Also, take the advice above and try out "iframes". Iframes are now supported by all the normal browsers and don't change the layout of your site, but only the page the iframe is on. In short, they are very useful.