[!--quoteo(post=379637:date=Jun 3 2006, 10:20 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 3 2006, 10:20 AM) [snapback]379637[/snapback][/div][div class=\'quotemain\'][!--quotec--] In this piece of code: [code]<?php //Change {config|X} to $config['X'] function parse_config($string){ $old = array("\{config|url\}", "\{config|mysql_server\}", "\{config|mysql_db\}"); $new = array($config['url'], $config['sqlserver'], $config['dbname']); $new_string = str_replace($old, $new, $string); $template_parsed['config'] = $new_string; } ?>[/code] Where is the $config array initialized? I don't see it anywhere, so your $new array doesn't contain what you think it does. I would pass the $old & $new arrays to your function instead of defining them in the function. [code]<?php $old = array('{config|url}', '{config|mysql_server}', '{config|mysql_db}'); $new = array($config['url'], $config['sqlserver'], $config['dbname']); $template_unparsed['header'] = html_doctype(); parse_config($template_unparsed['header']); echo $template_parsed['config']; function parse_config($string,$o, $n){ $new_string = str_replace($o, $n, $string); $template_parsed['config'] = $new_string; } ?>[/code] Ken [/quote] Thanks. The $config[x] variables are set in another php file called config.php (don't worry, that is required()). config.php [code]//MySQL Details //MySQL Database Name $config['dbname'] = ""; //MySQL Server $config['sqlserver'] = "localhost"; //MySQL Username $config['sqlusername'] = ""; //MySQL Password $config['sqlpassword'] = ""; //Server Details //URL of PASite setup $config['url'] = "http://localhost/perthacademy"; //DO NOT END IN TRAILING SLASH.[/code]