|
Posted by "php-mail" on 11/13/05 00:50
-----Original Message-----
From: Jasper Bryant-Greene [mailto:jasper@album.co.nz]
[snip]
application/text isn't a MIME-Type, is it? Do you mean text/plain?
[/snip]
Or maybe text/html?
Sent: 12 November 2005 22:46
To: Todd Cary
Cc: php-general@lists.php.net
Subject: Re: [PHP] Printing to a buffer
Todd Cary wrote:
> My client's new shared server does not allow printing to a file, so I
> want my print statement to print to a buffer, then I'll send it to the
> user via Headers. This does not work since "print" does no go to the
> buffer, or at least appears not to: I get the errors from the header
> statements;
>
> <?
> ob_start;
You're missing some parentheses on the ob_start function. I think you
meant to write:
ob_start();
> print "This is a test<bf>";
You probably meant <br> in that string too.
> $buf = ob_get_contents();
> $len = strlen($buf);
> ob_end_clean();
> header("Content-type: application/text");
application/text isn't a MIME-Type, is it? Do you mean text/plain?
> header("Content-Length: $len");
> header("Content-Disposition: inline; filename=Sfyc.html");
> print($buf);
> ?>
>
> Todd
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ NOD32 1.1284 (20051111) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
[Back to original message]
|