Re: Redirect output of include() for mailing
| From: | Reuben D. Budiardja | Date: | Tue, 22 Jul 2003 18:09:42 +0000 |
| Subject: | Re: Redirect output of include() for mailing | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156287@lists.php.net to get a copy of this message | ||
On Tuesday 22 July 2003 01:43 pm, David Nicholson wrote:
> Hello,
>
> This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at
> 18:37, lines prefixed by '>' were originally written by you.
>
> > But how can I instead capture the output of the include to
>
> variable
>
> > and mail
> > it, something like
> > $msg = include('myscript.php?foo=bar")
>
> Use output buffering...
>
> ob_start() // see http://uk2.php.net/ob_start
>
> include("youfile.php");
>
> $mailthis = ob_get_contents() // see
> http://uk2.php.net/manual/en/function.ob-get-contents.php
>
> ob_end_clean() // see
> http://uk2.php.net/manual/en/function.ob-end-clean.php
Thanks.
Will the same method works for a dynamically generated image using php?
Suppose that myscript.php output JPEG instead of HTML.
RDB
>
> HTH
>
> David
--
-------------------------------------------------
/"\ ASCII Ribbon Campaign against HTML
\ / email and proprietary format
X attachments.
/ \
-------------------------------------------------
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-------------------------------------------------