Hello,
I've learned how to use the request_uri to do things like control block visibility on a node, but I'd like to know if there is a similar way to call the url of an iframe from within the iframe.
I have an iframe and there are links inside the iframe that open different pages inside the same iframe. This is all fine. I want to use php to control the behavior within the iframe if a user clicks a certain link (anonymous users would be redirected).
It would be something like: The user clicks the link inside the iframe. Before the page loads inside the iframe, the php script would check if the user is authenticated (I know how to do this) and also would check if the url of the new frame is identical to a given url. If the user is anonymous, a redirect would take place.
Is there an equivalent to request_uri to obtain the iframe's url?
Comments
once you've displayed links
once you've displayed links on a page, iframe or not, it's beyond phps control what happens when they get clicked. It's the browsers job now.
Unless you stick callback redirects on each one :-(
it sounds like you are talking about client-side logic, and the way to get an iframes URL (if that is really what you are asking) is javascript document.location
Or, on the server side, the request URI.
You probably cannot detect server-side that a page is being requested in full-page or iframe view unless you've injected an extra argument to note that. Which is reasonable.
What i think you really wanted to do was serve different pages to different people in that iframe.
One with a target set to all its links, and one without, depending on your auth detection.
So figure it out at page-build time who will get what links...
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards