Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display object in iframe based on parent frame.

Posted on 2010-11-22
11
Medium Priority
?
460 Views
Last Modified: 2012-05-10
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
Comment
Question by:jameshuckabonetech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 59

Expert Comment

by:HainKurt
ID: 34189804
on your home page put the video
on the rest put an image ;) instead of video...
0
 
LVL 59

Expert Comment

by:HainKurt
ID: 34189941
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
 

Author Comment

by:jameshuckabonetech
ID: 34190866
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Accepted Solution

by:
scrathcyboy earned 2000 total points
ID: 34191544
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
 

Author Comment

by:jameshuckabonetech
ID: 34191565
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
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34192268
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
 

Assisted Solution

by:jameshuckabonetech
jameshuckabonetech earned 0 total points
ID: 34201635
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
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 2000 total points
ID: 34202238
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
 

Author Comment

by:jameshuckabonetech
ID: 34202350
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
 

Author Comment

by:jameshuckabonetech
ID: 34202355
I guess I'm going to give the points to scrathcyboy.
0
 

Author Closing Comment

by:jameshuckabonetech
ID: 34224746
Thanks for the idea.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question