I have a plain site that is setup to just read some small data from a database and display it on the page.

The scripts were originally setup and developed on a Linux OS but previously moved to a Windows 2K server. PHP 4.3.9 is installed on the Windows box.

The problem is, when viewing that pages with IE, they display fine. But if viewed with FireFox or equivilent, the pages want to download instead of view.

The download popup mentions "application/octet-stream"

There is no special code within the PHP files, just simple straight forward plain PHP. I can't seem to get this problem to stop so that both IE and Mozilla like browser view the files. This is a security problem ATM.

Anyone know a solution to this problem, if there is a server setting or a piece of PHP code I can use to stop this from happening.

Thanks in advance!!

    Hi,

    dou you use IIS or Apache ? Does a simple

    <?PHP
    phpinfo();
    ?>

    script show the same behaviour ? Please post the php.ini file (as attachment) used on the server.

    How did you install PHP ?

    Thomas

      Webserver is IIS. PHP was installed using the downloadable installer for windows off php.net

      I setup a phpinfo.php page and placed it in the same directory as the sites files. The phpinfo.php pages displays fine in both IE/Mozilla.

      I don't get it....

        Post the script. What type of data does the script show ?

        thomas

          Here it is ... ripped out the HTML crap though to make the post less overwhelming ... figure the PHP part is the problem somewhere.

          <?php
          session_start();
          require("include/config.php");
          include("include/functions.php");
          $header_include = '';
          DoLog("Welcome");
          ?>
          <html>
          <head>
          <title>Welcome</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          
          <script language="JavaScript">
          <!--
          	function popup_window(url)
          	{
          		link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=585,height=420,left=10,top=10");
          		link.focus();
          	}
          -->
          </script>
          <style type="text/css">
          body {
          	font-family: Helvetica, Verdana, sans-serif;
          }
          
          p { 
          	font-family: Arial, Helvetica, Verdana, sans-serif;
           	font-size: 12px;
          }
          
          td {
          	font-family: Arial, Helvetica, Verdana, sans-serif;
          	font-size: 12px;
          }
          
          th {
          	font-family: Arial, Helvetica, Verdana, sans-serif;
          	font-size: 12px;
          }
          </style>
          </head>
          
          <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
          
          
          
          </body>
          </html>
          

            You can post the script as attachment. There's a file input on the reply page (you need to rename the file to e.g. .txt).

            You wrote that Firefox shows a "save as" dialog. Save the script and post it as attachment, too.

            create a zip file and attach that zip file to your post.

            Thomas

              This will have to wait until I get out of work here and get access to the server. I'll zip up the whole dang site and attach it.

              Thanks for the help, very much appriciated...

              will post back in a few with attachment.

                9 days later

                thanks tsinka for the help ... turns out the problem was originating from some IIS site settings. Not sure exactly what property or setting it was atm, waiting for the server admin to get back to me about the details ... but everything is working fine now.

                Thanks again, and sorry for the MIA on this matter, kind of left the thread hanging without more feedback.

                  Write a Reply...