#native_company# #native_desc#

Sending RTF header with PHP

By Kelvin Jones
on March 1, 2002

I was looking for a way to print an RTF document to the browser however when I used this header:

header("Content-type: text/richtext");

.. IE just prompet me to download.

So after hunting around a bit I found the answer to the problem.. IE won’t display the output in the browser unless you have a .rtf extension.
So that means in Apache you must put something like this:

AddType application/x-httpd-php .php4 .php .php3 .phtml .rtf

NB: Don’t forget to use the header still.