Jump to content


Photo

PHP firefox issue


  • Please log in to reply
9 replies to this topic

#1 slipmatt2002

slipmatt2002
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 01:01 PM

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

#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 13 September 2006 - 01:03 PM

This means the webserver is not configured correctly :)

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

#3 black.horizons

black.horizons
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 13 September 2006 - 01:04 PM

is PHP installed on your webserver?!?!

#4 slipmatt2002

slipmatt2002
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 01:08 PM

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-under...co.uk/main.php. It is just this recent sote I am having issues with?

#5 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 13 September 2006 - 01:34 PM

The headers the web server is returning look like this:

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

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.

#6 slipmatt2002

slipmatt2002
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 13 September 2006 - 01:52 PM

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??

#7 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 13 September 2006 - 01:54 PM

I would imagine that PHP just isn't installed.

Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#8 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 13 September 2006 - 02:09 PM

Huggie, I doubt it would work in explorer and safari if php wasn't installed :)

#9 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 13 September 2006 - 02:24 PM

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
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#10 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 14 September 2006 - 02:31 AM

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)

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

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users