If you're literally talking about html frames, what you're talking about sounds like it could be accomplished with html or javascript?
If you're talking about a template into which you are including page2.php, page3.php, etc. ... there is more than one way to do that.
Easiest way is to include a variable in your links then include a different file depending on that variable.
<a href="template.php?pageID=2">page 2</a>
then in template.php...
if ($pageID==2) { include("page2.php"); }
elseif ($pageID==3) { include("page3.php"); }
etc.