• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

Display object in iframe based on parent frame.

The website I am working on has an iframe header graphic with a transparent flash movie ovelayed on top to introduce visitors to the site's features. The problem is that the video plays over again on every new page clicked. I would like to only play it if it detects that the parent frameset is the homepage. How would I do this in PHP?

My page is located here: http://www.happystreet.ca
0
jameshuckabonetech
Asked:
jameshuckabonetech
  • 6
  • 3
  • 2
3 Solutions
 
HainKurtSr. System AnalystCommented:
on your home page put the video
on the rest put an image ;) instead of video...
0
 
HainKurtSr. System AnalystCommented:
install Fiddler
browse the pages with your ip

not 127.0.0.1, not localhost, use internal ip like http://192.168.1.123/myweb/

and then Fiddler will show all parameters passing through browser & server... or if you use IE 8, hit F12 and then on the window select cookies to see what you have...
0
 
jameshuckabonetechAuthor Commented:
on your first comment, the header will always be the same iframe page. I can't change it because the content management system is crap. So every page will load the iframe over again.

I don't understand your second comment. I thought there would be an easy php function to do this, like,

current_page = get_parent_url();

then I could do:

if(current_page=="index.php"){
show the movie}

otherwise, don't.

Am I dreaming?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
scrathcyboyCommented:
No you aren't dreaming -- but with a CMS, there are limits, short of rewriting all the pages.  IN javascript you can test for the main page --

if (location.href == 'http://www.yoursite.com/index.html)  -- then you show the iframe, else you do not.

In PHP you would have a better chance of just eliminating the iframe with flash for all pages but index.html, and that is straightforward PHP code.

But you need to be able to edit the files to do any of this.  Can you?
0
 
jameshuckabonetechAuthor Commented:
I can edit the iframe only. That's what I want to do, with PHP, only show the flash on the main page. How do I do that?
0
 
scrathcyboyCommented:
I don't see the SWF file in the iframe.  Where is it?  If it is not in the iframe, and you can only edit the iframe code, I don't see how you can accomplish what you want.  Also the site is done with ASP programming and even though it is a real mess displaying in the browser (and took more than 35 seconds to load), you should be sticking with ASP and not introducing PHP.  

In reality, the site is badly designed.  If they aren't prepared to design it where it works in modern browsers, I don't think there is much you can do for them.
0
 
jameshuckabonetechAuthor Commented:
I figured it out. I just used the following:

if($_SERVER['HTTP_REFERER']=="http://www.remax-crest-vancouver-bc.com/"){

show the flash

}

I knew it was something easy. Sorry if I was unclear.
0
 
scrathcyboyCommented:
Which is what I said in javascript --

if (location.href == 'http://www.yoursite.com/index.html)  -- then you show the iframe, else you do not.


The correct way to close this question is to split points among people who helped or tried to help you by leading you in the right direction.  I figured it out on my own -- many questioners do, but our input helps.
0
 
jameshuckabonetechAuthor Commented:
I'm sorry, but my original question ended with "How would I do this in PHP?"

I'll split the points with you anyways.
0
 
jameshuckabonetechAuthor Commented:
I guess I'm going to give the points to scrathcyboy.
0
 
jameshuckabonetechAuthor Commented:
Thanks for the idea.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now