SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Creating RTF?

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    UK
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating RTF?

    Hi all,

    I'm trying to an RTF as a template and replace some placeholders with values, but it's just outputting the code that makes up an RTF instead of creating the RTF.. Here's the code:

    PHP Code:
    <?php 

    header
    ("Content-type: application/rtf"); 
    header("Content-Disposition: inline, filename=cert.rtf");

    $filename "mentor.rtf";
    $fp fopen($filename"r");

    $output fread($fpfilesize($filename));

    fclose ($fp);

    $name "John Smith";
    $output str_replace('<< NAME >>'$name$output);
    print (
    "$output"); 

    ?>
    Am I missing something?

  2. #2
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does it work when you don't manipulate the RTF code? If not, then it probably is some sort of header problem.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    UK
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't know where to start manipulating the RTF Code though...

    Every tutorial I've found on the subject use exactly the same header code as I have used....

    Christmas confusion has set in.

  4. #4
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Sorry but I just needed to verify for my self that by RTF you guys are talking about Rich Text Format.
    Erh

  5. #5
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I believe that's what he's talking about.

  6. #6
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    UK
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep.... thats what I'm talking about


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •