Solved

identify when a url changes

Posted on 2013-11-22
8
202 Views
Last Modified: 2013-11-23
I load a login web page: https://docmein.com/app/page/12801944916418372/login into a frame. I do not have programming rights of this page. When a user successfully logs in, the page changes to: https://docmein.com/app/page/12801944916418372/secure/home. I would like to identify when the page changes so I can then load instructions in other frames. Is there a way to identify the new page? TIA
0
Comment
Question by:thenelson
  • 3
  • 3
  • 2
8 Comments
 
LVL 16

Expert Comment

by:HagayMandel
ID: 39669037
If you do have programming rights on the second page (the one to which the loggedin user is directed to), then, you can check which page is the referer:
if ($_SERVER['HTTP_REFERER'] == "https://docmein.com/app/page/12801944916418372/secure/doLogin"){
  // Show (redirect to) the instructions page
}

Open in new window

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39669364
What Hagay suggested should be fine as long as the page is from the same domain as the parent page.

If the loaded page is from another domain, then you cannot use javascript to reference the internals, because it would be a security violation (cross-domain scripting).

Cd&
0
 
LVL 39

Author Comment

by:thenelson
ID: 39670243
I do not have programming rights on the second page and the page is not the same domain as the parent page.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Assisted Solution

by:HagayMandel
HagayMandel earned 250 total points
ID: 39670276
In that case, you can't.
Any trick to bypass this obstacle requires knowledge of what privileges you do have. For example can you manipulate the .htaccess file? if so, you can force all traffic through a filtering page that checks, the referrer or the existence of a certain cookie and redirect the user accordingly.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 39670594
If you are accessing a page that belongs to someone else the correct approach is to contact them and see if they have an API you can use, or work out a protocol you can use for access server side, and return the result from your own server.  

Trying to do what you want without the permission of the owner of the target page could be viewed as an attack, and in some jurisdiction might result in legal action.

Cd&
0
 
LVL 39

Author Comment

by:thenelson
ID: 39671889
So there is no way to determine what page is being viewed in an iframe in a cross domain situation?

The reason I am try to do this is the website docmein.com is poorly designed so our patients are confused on how to accomplish what they need to do. For example, assume you want to schedule a new appointment and cancel an old appointment, what would you do at the page: https://docmein.com/app/page/12801944916418372.  I have explained this to my contact at docmein.com and made suggestions but got no response. So my next best solution is to provide instructions alongside the web page loaded in an iframe.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39672038
If the owner of the target page is not willing to co-operate, then the best you can do is give instructions on how to fill out the form.  Generally a badly designed form lives a long time because instead of complaining people just find another place to do business; and site owners don't respond unless they get as lot of complaints because they think everything is just fine "the way they have always done it".

Sorry I don't have any real solution.

Cd&
0
 
LVL 39

Author Closing Comment

by:thenelson
ID: 39672113
Oh well, not the answer I wanted but....
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

733 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