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

Can PHP be used like iframes?

I have put a site together using two iframes (to allow continuous music).

These iframes are not displaying properly though in IE8 and Chrome so i'm wondering if it is possible to use PHP include rather than an iframe?

It would need to work so the user actually stays on one page but navigates around the site in the same way as an iframe.

Is this possible?
0
BrighteyesDesign
Asked:
BrighteyesDesign
  • 5
  • 3
  • 3
  • +3
4 Solutions
 
Loganathan NatarajanLAMP DeveloperCommented:
yes, you can include it in the IFRAME
0
 
BrighteyesDesignAuthor Commented:
Thanks for that, the thing is though is that the problem is with the iframe so i'm guessing the problem will still be there i'll give it a go though.

How would the code be, I have tried this but I get a 404.html even though that URL path is correct?

 <iframe src="<?php include("http://www.riad-hikaya.com/enter.html"); ?>" width="1062" height="645" scrolling="no" frameborder="0" id="frame1"  allowTransparency="true" background="transparent"></iframe>
0
 
Marco GasiFreelancerCommented:
Hi, BrighteyesDesign. Using include you change nothing: php include only 'includes' all code within the included file into the iframe. For browser which receives tha page top display this changes nothing respect to use normal iframe syntax: the page browser receives is the same...
0
Independent Software Vendors: 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!

 
Beverley PortlockCommented:
If your IFRAME has a different domain than the surrounding page then this can trigger a security setting in IE.  The solution is to specify a P3P tag.

http://www.w3.org/P3P/

See this for an example of what someone else went through

http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer

0
 
BrighteyesDesignAuthor Commented:
Thanks for that, everything is on the same domain though.
0
 
Beverley PortlockCommented:
Fair enough, but remember that domain.com  and sub.domain.com also count as different.

Cheers

BP
0
 
Marco GasiFreelancerCommented:
@bportlock, the problem is that asker uses iframe to play continous music in his site - wonderful site but unfortunately I think I'll never can sleep in that residence...:-( Site works perfectly with all browsers except IE8 and Chrome. It seems to be a css problem than a php problem: I can't help him, maybe you can but I fear you're talking about an unrelated question which can confuse the real problem here :-)

Bye
0
 
Beverley PortlockCommented:
@marqusG

When I see the words 'iframe', 'ie' and 'not working' in the same sentence I remember a particularly horrible day I had thanks to IE7 and the P3P problem. I have seen it bite others too, particularly when it is mentioned that other browsers are OK.

It may well be a different problem, but if it is not then this is not the sort of thing that people think of. If it is not the problem then that is OK with me - I am not pushing it as the solution, but at least the OP is aware of this potential bump in the road.

BP
0
 
Marco GasiFreelancerCommented:
Oh, well, I misunderstood your intentions and I apologize for this. On to the next :-)
0
 
BrighteyesDesignAuthor Commented:
Thanks all,

I have figured out that when JQuery is removed from the page it works ok.

The thing is I need JQuery on there which is why I was looking to ditch iframes and look if pure php was possible.

The original, more general question is still open here http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_27295018.html
0
 
Ray PaseurCommented:
Here is the issue as I see it.  To start the music playing you have to make a request to the server.  When the connection closes, the server will probably stop playing the file.  Certainly the browser would stop playing the file when the connection closes.  So if you want to have continuous music and still navigate the site, you must keep two requests in play at all times - one for the music and one for the web pages.

There is no really good design pattern for what you have described, but there may be an idea if you use an external browser tab or window for all the non-music web pages.  You would use the target attribute of the href tag to open a new tab or window.  However this by itself will not give the client the music if the pages are deep-linked.  To achieve that you would probably need to use a cookie of some sort and dynamically generate the site navigation.
0
 
BrighteyesDesignAuthor Commented:
Thanks all, i'm guessing that's a no to pure PHP solution then for this problem. Elsewhere, I have been pointed towards AJAX so i'm going to see what that's all about!
0
 
Slick812Commented:
greetings BrighteyesDesign, having your music be continuous while navigating from page to page, may be a problem. I had a fairly sussesful set up for that, using the old style "frameset" with the flash music player in one frame and the page contents in another, you might look at the instructions for framesets here - http://www.w3.org/TR/html4/present/frames.html
However, they may have some or all of the problems using the JQuery JS framework, some JS like JQuery and Mootools, when they are first loaded do a document object model "Scan" for page elements they need to have "configured" or "captured" for the event monitor etc. , this may cause the flickering, or the IFrame failure for you. I can not think of a way to use PHP as placing a DIV with code that might do what you need, ,
AS far as what I would try to do, is use an AJAX send-receive to change the "Page Content", so you can have the music play without ever changing the entire page... Just My thoughts, I feel that the "Old Way" is to change page contents by changing the web address of the browser with a "Link", , due to increased bandwidth for most ISP, I see more and more web sites using the "New Way" of changing user content with AJAX. I have spent a good deal of time recently updating many of my pages to use AJAX or javascript to change page views, instead of links.
0
 
BrighteyesDesignAuthor Commented:
Thanks Slick,

I actually looking at AJAX now, i'm just having trouble loading some JQuery content...

I have a question open here if you can help?   http://www.experts-exchange.com/Programming/Languages/Scripting/AJAX/Q_27296093.html#a36498716
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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