Jump to content

Archived

This topic is now archived and is closed to further replies.

slipmatt2002

PHP firefox issue

Recommended Posts

I wonder if anyone can help. I have just designed a website for a client www.dunmar.co.uk. It all works fine in explorer and safari but when I open it in firefox and enter onto the first .php page (www.dunmar.co.uk/index2.php) i keep getting a popup window appear saying:

you have chosen to open index2.php
What should firefox do with this file?
• open with PHP document
• save to disk

and I cant get any further on the website. I am not sure if this is a problem with my PHP but would appreciate any advice. Sorry if this is something really obvious but I am quite new to this.

Thanks
slipmatt2002@yahoo.com

Share this post


Link to post
Share on other sites
This means the webserver is not configured correctly :)

Which webserver are you using? (Typically Apache, or IIS)

Share this post


Link to post
Share on other sites
I am not 100% sure if PHP is configured on my web server, i know i can view other php pages through firefox like my own site i have done http://www.mis-understood.co.uk/main.php. It is just this recent sote I am having issues with?

Share this post


Link to post
Share on other sites
The headers the web server is returning look like this:

[code]HTTP/1.x 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Date: Wed, 13 Sep 2006 13:34:46 GMT
Content-Type: application/octet-stream
Accept-Ranges: bytes
Last-Modified: Wed, 13 Sep 2006 11:08:59 GMT
Etag: "c0a3f8225d7c61:de8"
Content-Length: 3988
Connection: Keep-Alive[/code]

The problem here is Content-Type: application/octet-stream.  It's a server configuration error that this conent-type is being returned.  Unfortunately I can't help you with fixing it, as I'm not familiar with IIS

Maybe you can fix it by sending header("Content-type: text/html") from your php script.

Share this post


Link to post
Share on other sites
Thanks for that, I have checked my PHP and in the head tags it has
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Not sure if that is what you mean but it is still not working.

It is confusing me because I have set up several sites the same and it just seems to be this one that is causing me trouble, it is hosted by a different company, do you think this could be something to do with it??

Share this post


Link to post
Share on other sites
Huggie, I doubt it would work in explorer and safari if php wasn't installed :)

Share this post


Link to post
Share on other sites
lol... I read that and then completely disregarded it... My bad and apologies  :-[

A side note, you might want to close the <!DOCTYPE tag at the tom of the HTML.

Regards
(A very embarrassed) HuggieBear

Share this post


Link to post
Share on other sites
Actually what I meant was this, right at the top of your php file (before ANY html at all, even blank spaces.. otherwise you can't modify the headers)

[code]<?php header("Content-type: text/html") ?>[/code]

If that's not the very first line in your file, it won't work.  You can have some php code before it, but no html.

What that will do is it will modify the headers returned by the server.  This is different from the "meta" http-equiv tags, which tell the browser "Pretend you saw this header instead of the one you really saw" :)

It's possible that firefox is treating the real header (which says your script is an octet stream) as more trustworthy than the meta http-equiv (which says your script is html), but explorer and safari are trusting the http-equiv.  If you can make the real header say "text/html" too, then that might fix it.  Of course IIS might ignore your header() instruction.. but it's worth trying.

Good luck :)

PS What the browser returns after an HTTP request is actually a series of headers (as in my earlier post), followed by the HTML.  Normally you never see those headers, because the browser reads them and interprets them but never displays them.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.