I just put your code into the template on my site and it works just fine.
If you are still getting the This is a Serious Error message on your page, then go into debug mode and see what the real error is.
To enable debug mode edit the /config.php file and change:
Code:
$config['debug'] = false;
To:
Code:
$config['debug'] = true;
Then edit the /core/includes/config.php file and change:
Code:
// $config['Misc']['debug'] = true;
To:
Code:
$config['Misc']['debug'] = true;
To set that up for only your IP address (replace xxx.xxx.xxx.xxx with your IP), put these lines around the code:
Code:
if($_SERVER['REMOTE_ADDR'] == "xxx.xxx.xxx.xxx") {
CODE HERE
}