use str_replace() when possible, it uses less resources. I am assuming you are reading an entire file into a variable and then echoing it out? Use this...
$file_contents = str_replace("[[username]]", "$filtered_form_post_username", $file_contents);
and do the same for each variable. But why don't you just echo out the file contents with the $variables already in it?
$file_contents = "Welcome $filtered_form_post_username. Etc...";
print "$file_contents";
Anyway, I hope that helps you.