[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[K12OSN] php - automatically opening up an rtf file in a browser



I have this code that worked in WIndows and I tried to modify it for Linux and it isn't working.  

It basically takes an existing rtf file and replaces the text with something else and I'd like the rtf to load up within the browser.  In Windows, a popup window comes up and it has an option to open an rtf file like Word or WordPad.  For Linux some of the students are getting Firefox as the only opetion and others are getting Bluefish as the only option.  No one is getting OpenOffice.

Is there an easy way to fix this?  Do I have to change something in my httpd.conf file?

Here is the code:
        $name = $_POST['html_name'];

        if(!$name)  echo "Error";
        else
        {
                //generate headers for the browswer to choose
                //the correct application
                header('Content-Type: application/rtf');
                header('Content-Type: inline, filename=something.rtf');

                //get the file
                $filename = "example.rtf";
                $output   = file_get_contents($filename);

                //replace items
                $output = str_replace('<>', $name, $output);

                //send the generated document to the browser
                echo $output;
        }

?>

_________________________________________________________________



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]