Jump to content

Get Current URL in an iFrame ?


Nesta92

Recommended Posts

Hello,

I need to get current url on a page in an iFrame.

The code must be in the iFrame and get current url of the parent page.

 

I tried with {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI} but it gives me the url of iFrame and not the parent page URL.

Any ideas ?

Thanks a lot and sorry for my English ...

Link to comment
Share on other sites

My guess would the referrer. So probably something like {$smarty.server.HTTP_REFERER} .

Otherwise I am not sure whether this is possible at all. You could check by printing out the $_SERVER and $GLOBALS variables in the iframe and look what they contain.

Of course there is always the option to give the string that calls the iframe content an extra argument that tells you who made the call.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...