Good script ... but what do you have to set like on top of every page?
(I know... but others, who don't know PHP that well won't. Please add in your topic

.)
Also, you should use the PHP-tags, instead of the CODE-tags:
[ php] [/ php]
(without the spaces)