I've used this
frameset.php
<html>
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!--
defaultsubpage="main.php";
if (location.search) {subpage=location.search.substring(1)}
else {subpage=defaultsubpage}
if (subpage.indexOf('&&&')>=0) {
prefix=subpage.substring(0,subpage.indexOf('&&&'))+"://";
suffix=subpage.substring(subpage.indexOf('&&&')+3,subpage.length);
subpage=prefix+suffix;
}
// -->
</SCRIPT>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(
'<frameset rows="55,*,50" frameborder="0" border="0">',
'<frame src="navigasjon.php" name="topp" id="topp" frameborder="No" scrolling="No" noresize marginwidth="0" marginheight="0">',
'<frame src="'+subpage+'" name="main" id="main" frameborder="No" scrolling="Auto" noresize marginwidth="0" marginheight="0">',
'<frame src="bunn.php" name="bunn" id="bunn" frameborder="No" scrolling="No" noresize marginwidth="0" marginheight="0">',
'</frameset>'
);
// -->
</SCRIPT>
</html>
file.php
<head>
<script>
function detect()
{
framesetpage="index2.php";
thispage=window.location.href;
if (thispage.indexOf('://')<0) {thispage="://"+thispage;};
prefix=thispage.substring(0,thispage.lastIndexOf('://'));
suffix=thispage.substring(thispage.lastIndexOf('://')+3,thispage.length);
// alert('the subpage is:['+prefix+']['+suffix+']');
if (parent.location.href==window.location.href) {parent.location.href=framesetpage+"?"+prefix+"&&&"+suffix};
}
</script>
</head>
<body onLoad="detect()" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor='#bcbcb4'>
modify the code so it suites your needs
Thomas