I might be wrong but I don't think you can get the name of the parent window of an iframe using PHP, it can only return information regarding the iframe itself.
There are a couple of things that may work, you could try a javascript solution, I'm not great at javascript but I think it'd be something along the lines of:
PHP Code:
<script type="text/javascript">
if(top.location.href != 'http://www.domain.com/forums/index.php') {
document.write('your code to display the full screen mode link');
}
</script>
Alternatively, in your
http://www.mysite.com/forums.htm page, when you specify the iframe src, add a querystring variable. Then in your iframe page, check if the querystring variable is present, if it is then it's likely that you are inside the iframe:
PHP Code:
// http://www.mysite.com/forums.htm
<iframe src="http://www.mysite.com/forums/index.php?framed=yes">
// http://www.mysite.com/forums/index.php
if(isset($_GET['framed'])) {
// we are in the frame, show full screen mode link
} else {
// we are in full screen mode, don't show the link
}