ive been searching these forums for ahwile, and searching other places, and cant seem to find what im looking for.
i have a website, which uses an iframe to display the site content, but with a navigation system always showing at the right.
when people search google or somethin and my site comes up, it often comes up as the page that is to be shown in the iframe, and theres no navigation on the left because of this. they have no way of browsing my site because of this also.
ive been searching for ahwile for a script that will check to see if the page is the (top) link (?) like in the nav bar, and if it is not, to reload to the one i want.
ie. many people are refered to my site at news.php but this shows just the news and not the nav.
but if you goto the main site it shows the news.php in an iframe.
if anyone knows how to make it check to see if a page is the baseurl and refresh to another one if it is, i would be greatly appreciative.
thanks
check baseurl / foward to another - help please
Moderator: General Moderators
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
You could play with showiframe.php:
and iframe.php:
Open showiframe.php in one window and iframe.php in another and see what you have to/can do with window.parent.location, top.frames.length and top.location.href.
Regards,
Scorphus.
Code: Select all
<html>
<head>
<title>.o0 PHPDN :: Iframe example - showiframe.php 0o.</title>
</head>
<body>
<iframe src="iframe.php"></iframe>
</body>
</html>Code: Select all
<html>
<head>
<title>.o0 PHPDN :: Iframe example - iframe.php 0o.</title>
<script language="JavaScript1.2" type="text/javascript">
<!--
function checkForIframe () {
document.writeln(window.parent.location);
document.writeln(top.frames.length);
document.writeln(top.location.href);
}
//-->
</script>
</head>
<body>
<script language="JavaScript1.2" type="text/javascript">
<!--
checkForIframe();
//-->
</script>
</body>
</html>Regards,
Scorphus.