#1
  1. No Profile Picture
    alexkay
    Guest
    Devshed Newbie (0 - 499 posts)
    I would like to have the results of my php script displayed as plain text instead of html.
    The browser would show (xxxx.txt).
    This would save the explanation to users on how to convert ( save as ) from xxx.html to xxx.txt.
    Any help with this code would be appreciated.
  2. #2
  3. No Profile Picture
    cbolt
    Guest
    Devshed Newbie (0 - 499 posts)
    This will show the results as plain text, but won't show xxxx.txt in the location since that can't be arbitrarily set...

    before sending any data:

    <?
    header("Content-Type: text/plain");
    ?>

    If you really want it to show xxxx.txt in the location bar, you could have your script redirect to scriptname.phtml/whatever.txt, just make sure you include the full server name in the redirect... like this:

    <?
    header("Location: http://www.blah.com/script.phtml/whatever.txt");
    ?>

    Or you could make a form post to that url, saving you from having to redirect.

Similar Threads

  1. help with tables and wordwrapping
    By junkedBrian613 in forum PHP Development
    Replies: 2
    Last Post: February 15th, 2004, 05:42 PM
  2. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 06:19 PM
  3. float question
    By yeah-yeah in forum HTML Programming
    Replies: 10
    Last Post: January 15th, 2004, 03:59 PM
  4. getting truncated results with text box
    By trisha150 in forum PHP Development
    Replies: 2
    Last Post: January 3rd, 2004, 04:58 PM
  5. Javascript scrollbar - stuck on last bit
    By NayMyoSan in forum JavaScript Development
    Replies: 0
    Last Post: January 3rd, 2004, 12:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo