Okay. I see the problem. I didn’t realize you were talking about pasting this into the editor. PHP won’t execute if pasted into a post, a page, or a text widget (maybe other places as well), though you can use PHPExec to change that.
i want it only on one page, not all pages…
I understand. You can select which template file that WP uses on a page by page basis. For example:
1) Take the code I gave you and create file named cat5.php in your template directory.
2) Go to wp-admin->Pages->Add New and create a page selecting cat5 from the menu on the right under ‘Template’. Let’s say you give this page the title ‘My New Page’.
Now, the page titled ‘My New Page’ is the only page that will use the cat5 template, although you could assign the template to other pages later if you want. See how that works? That is what I thought you were trying to do.