There's not much to say about this, that hasn't been said already. So what I'm going to do is to direct you to the TSref, section "PHP include scripts" in the end of the document. There's a very fine "Casestory" which you can do as an execise.
Also there's a great demonstration on the testsite, you're working on. Unfortunately you've been working on a test-template, so directing you to page "index.php?id=30" will only display your last adventures with the test template. So, deactivate your test template for a while and check out the guide:
(Remember to "Clear All Cache" in the [menu] after deactivating...)