<? // Switch statement cheks style id number and sets template acordingly :) switch($_GET[style]) { case '1': $template = file_get_contents('./style1.tpl'); break; case '2': $template = file_get_contents('./style2.tpl'); break; default: $template = file_get_contents('./style1.tpl'); break; } // our data we want ont he page $content = "hellloooo world!"; $content .= '<br><a href="?style=1">Style 1</a> '; $content .= '<br><a href="?style=2">Style 2</a> '; // Find the variable %content% and replace it with the text above. find it in the vairable $template(specified above). // Place the new data into the variable $output. and echo it to the screen $output = str_replace('%content%', $content, $template); echo $output;?>