Link to home
Start Free TrialLog in
Avatar of thenelson
thenelson

asked on

identify when a url changes

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
Avatar of Hagay Mandel
Hagay Mandel
Flag of Israel image

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

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&
Avatar of thenelson
thenelson

ASKER

I do not have programming rights on the second page and the page is not the same domain as the parent page.
SOLUTION
Avatar of Hagay Mandel
Hagay Mandel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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&
Oh well, not the answer I wanted but....