Can I get some Help

Javascript coding ..

Moderators: macek, egami, gesf

johnvem
New php-forum User
New php-forum User
Posts: 6
Joined: Fri Sep 16, 2005 4:21 am
Location: Denmark
Contact:

Can I get some Help

Postby johnvem » Fri Sep 16, 2005 4:49 am

:help:

I have a litle problem. Im webmaster on an older site witch is build with frames. A master php file loads in the main and loades the rest when they are called fore.
I want to make shure that its not posible to open a secundary php file unless its done by the master.
How do I do that?

John
[/code]

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Fri Sep 16, 2005 10:39 am

this is a javascript question.. just check the window.location of the frame and the window.top.location if they are the same: the file is opened outside the frames.
This is a client side problem and not server side --- moved

johnvem
New php-forum User
New php-forum User
Posts: 6
Joined: Fri Sep 16, 2005 4:21 am
Location: Denmark
Contact:

Postby johnvem » Fri Sep 16, 2005 1:52 pm

Thanks a lot I didnt know i had to do it with Java. :o I did like this and it works!

Code: Select all

 <script language="JavaScript">
<!--
var win=window.location;
var wintop=window.top.location;
 
if (win==wintop)
{
window.location="http://www.website.com/index.php";
}
//-->
</SCRIPT>


Just perfekt!

John :D


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest

cron