andyjimmy Posted October 31, 2006 Share Posted October 31, 2006 Hi All,The title of my question does seems rather ambiguous, but please allow me to explain. What i'm looking to impliment is this, I want http://mydomain.com/artist/artist_name.html to load in two different ways depending on how they are loaded.For example if you put http://mydomain.com/artist/artist_name.html into your browser address thingo it loads up the page complete with page headers, the information about the artist and the page footer, just like a normal website.--BUT--If its loaded in an iframe it only displays the artist info.I hope that makes sense. So what i'm after is something in the artist_name.html that recognises the iframe that it has been loaded in. Does anyone know if this is even possible, can anyone point me/ provide me with some code etc that would give the desired result.Kind Regards and thanks in advance!! Quote Link to comment Share on other sites More sharing options...
tomfmason Posted October 31, 2006 Share Posted October 31, 2006 Well this could be done with php rather easily. I am not so sure about javascript. Here is an example.[code=php:0]$referer = $_SERVER['HTTP_REFERER'];if ($referer !== 'http://www.yoursite.com/yourframedpage.html') { header('Location: http://www.yoursite.com/yourframedpage.html');}[/code]Good Luck,Tom Quote Link to comment Share on other sites More sharing options...
andyjimmy Posted November 1, 2006 Author Share Posted November 1, 2006 Thanks Tom,A very simple solution, thankyou, i hadn't even thought of using php to fulfil this need, but serverside is definately a better solution!Andy Quote Link to comment Share on other sites More sharing options...
tomfmason Posted November 1, 2006 Share Posted November 1, 2006 Your welcome..There is a way to reference the referer with javascript.that is [code=php:0]document.referer[/code]However, server side would be the best method.Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.