Firefox obstructs loading php file into iframe

I have stuffed around with this problem for too long so

I have two files,a page containing an iframe (doesnt seem to matter whether its hidden or not) and the file for the iframe
I am loading the iframe with a php file (eventually will be from another sites server but i need it to work on mine first). So far It works locally on my desktop..both files are local, same directory..no probs with Firefox or IE.

So I uploaded the files to my website and

IE works fine ...iframe loaded and alls well.
Firefox comes up with a window saying words to the effect of

You have chosen to open

timestuff.php

which is a php file

what should firefox do with this file?

.   open with   then a choice of php auto file or other

. save to disk



selecting php auto it opens notepad, select other it opens a directory looking for applications. The answer to its question is..put it in the frickin iframe.

Now..if I try this with a different source of the same php file (ie from a different site). I say its the same as the HTML is the same ..whether there are hidden characters I dont know. The iframe loads but I get access denied later in my script (to be expected due to diff domains)

So if anyone can help it would be appreciated

Cheers



rscandc0Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nitinsyCommented:
You are using a PHP. I am assuming you want this to execute on the server and just return plain HTML to the client. With the information you have given, it appears your web server is not configured to process PHP files. It is probably sending the wrong content-type header to the client. Try typing the iframe URL into the address bar and see what happens.

Which web server are u using?
rscandc0Author Commented:
Thanks for your response.  OK. I am activating the php by making it the source for the iframe, and yes I am expecting HTML to be returned. I already tried the iframe url in the address of Firefox and IE...IE is fine and Firefox intervenes. However firefox does load the correct (with the exception of any non visible data) into notepad when I select that option.

So how come it works with IE with the same php file if the server is not configured to process php files?? (I know that FF and IE do things differently but this seems a bit fundamental.

The site is users.bigpond.net.au which uses MS IIS 5.0 Webserver

nitinsyCommented:
From what you are describing it seems to be a problem with the content-type header being sent to the client. Try create a MIME map entry in IIS for php extension.

Content-type should be text/html for the browser to render it as html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rscandc0Author Commented:
I have accepted your answer. It was a content type issue. It was the PHP script not working and no html output so i just got the php file not the raw HTML (who knows why...don't ask) . The PHP file contained HTML with the correct Content-type but I guess Firefox didnt understand and put it in the "too hard" basket.  I cant mess around with the PHP script so am putting the expected PHP output as an HTML file on the server and downloading that. You may say why!!! Well I am trying to test as much in the real environment as I can. And of course the gotcha now is that Firefox tells me permission denied when I try and access the innerHTML in the Iframe even tho the file in there is from the same domain as the main page. Probably missing data due to the way I put it there..eg no headers generated by a real php script.

Any ideas how the browser determines permission denied  ie where does it get the domain name for the iframe page..it is certainly not in the HTML (or is this a separate question??) HTTP headers maybe??

Anyway thanks for your help.... I still need to try and test this stuff until I can get in touch with the person whose PHP script it is so the problem has moved on.

BTW interesting how benign and tolerant  IE is with this scenario
nitinsyCommented:
Both browsers use the domain name in the url to avoid cross-domain scripting. There are no headers that define the domain. Just make sure both domans are the same.

Another thing that could cause this problem is the timing of accessing the iframe content. You should do it after the iframe has loaded completely. This can get tricky because you want to access the iframe from the main browser windows while the load event is triggered inside the iframe (on the body tag of the html in the iframe).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.