Solved

Is there any way to know currently displayed URL in Netscape Browser.

Posted on 2004-03-25
16
202 Views
Last Modified: 2006-11-17
Is there any way  to know any URL is currently displayed in Netscape browser? Suppose http://www.xyz.com is running in Netscape browser, do i have any way to know the URL name whatever is running currenlty. One more flexibility is there that the URL name will be known to me before searching.
0
Comment
Question by:ghananil
  • 4
  • 3
  • 3
  • +3
16 Comments
 
LVL 8

Expert Comment

by:william_jwd
ID: 10676115
if you get window.location, you can get the currently displayed URL in any browser.  From where do you want to know the currently displayed URL ?
0
 

Author Comment

by:ghananil
ID: 10676642
Let me explain the exact problem. I want add php/javascript code to a page so that, It can find out is the URL say "www.xyz.com" is already running or not at the time load of PAGE.
0
 
LVL 6

Expert Comment

by:CosminB
ID: 10676810
try this:
<script>
var img=new Image();
img.src= "http://yourserver.com/path/to/script.php?browserLocation="+top.location.href;
</script>
0
 
LVL 1

Expert Comment

by:essage
ID: 10676836
This code should work:
 
<script language="javascript">
document.writeln(document.location);
</script>
0
 
LVL 6

Expert Comment

by:CosminB
ID: 10676901
If you find out the referrer of your page and compare it with your current page(to see if the refresh button has been hit)
just do
<?
if ($_SERVER['HTTP_REFERER'] == 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_URI'])
{
  echo 'you hit refresh';
}

?>
0
 

Author Comment

by:ghananil
ID: 10677447
Probably I was clear in question. suppose on one Netscape window "www.xyz.com" is dispalyed/running and if I open one more new window and try to open same "www.xyz.com" now in this case in second window i wanted to display like www.xyz.com is opened in another window.

Thanx your earlier comments and sorry for making confused. please let me know can we solve this problem.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Accepted Solution

by:
CosminB earned 50 total points
ID: 10677802
There is no way of telling how many windows are opened by netscape to view your site because of security reasons
0
 
LVL 6

Expert Comment

by:jkna_gunn
ID: 10677825
if the 2nd was opened by your page then you could use javascript to get the url of the parent window.

var url = window.opener.location.href;

but if you mean when you use the broswer and go file->new->window. thats a different story.
0
 

Author Comment

by:ghananil
ID: 10677842
but if you mean when you use the broswer and go file->new->window. thats a different story. this what I was lookin g for.
0
 

Author Comment

by:ghananil
ID: 10677966
Thanx cosminB.

I want to add a few more things which in other way will help me to solve my problem. Is there a way that I can have event like onbeforeunload in javasrcipt( specific to IE, tried with Netscape didnot work) also in PHP/JAVASCRIPT (specific to Netscape, I want for netscape) which event get called even someone click on cross button of browser.
0
 
LVL 6

Assisted Solution

by:jkna_gunn
jkna_gunn earned 50 total points
ID: 10677981
0
 
LVL 6

Expert Comment

by:jkna_gunn
ID: 10678000
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 10752379
if the point is that u do not want a user to be able to open your application twice, there could be one way.
if u use sessions in php, you can make a javascript which at loging time either open a hidden window or set a global variable "session_is_opened=1;".
then, when a page is loaded, if the session already exists but the variable is not set, or the hidden window can't beaccessed, then your user has opened another browser window and pasted the url (so the session is kept but the browser-depending operation is not) which is what you want to detect ???
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now