Which are all good answers, but lemme see if I can explain the concept so it makes more sense. I basically ask you to put
into your page. You then save that page with the extension .php and set it to be executable... that is, a script that will be run (like a program) by the server before it serves it to viewers. When the server runs that script, it won't do anything at all with the rest of your page as it's just normal HTML. All that just gets sent straight on through to the viewer's webbrowser. When it comes to a php section though, it will run that bit as a sort of program/script. The code you include above basically tells it to grab/include and run a bigger script/program saved as "newsbox.php" That script does a lot of stuff, like checking what username it's running as, looking up info about your site, etc. What it spits out is the html that makes the newsbox you see on the pages here.
So you're correct in your original assumption, that it won't work viewing it on your own computer. Your computer doesn't have the newsbox.php script, nor the database and such that let it look up your site info, the news items, and the other stuff that goes into the newsbox. If you view it directly on your computer, there won't be anything where the newsbox should be, as there's no program running on YOUR computer to create it.
To further explain, here's two examples. First, this is raw code that someone might have for their webpage.
http://xepher.net/newsbox-source.phpNext, this is what that code actually outputs AFTER it's run.
http://xepher.net/newsbox-example.php If you view the source code there, you'll see all the PHP stuff disappears, and it's been replaced by the actual tables and such that make up the newsbox.
I hope that clears things up.