Re: how can I use an external 'template' file and still use PHP variables?
| From: | Noel Wade | Date: | Fri, 10 Jan 2003 10:52:46 +0000 |
| Subject: | Re: how can I use an external 'template' file and still use PHP variables? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131078@lists.php.net to get a copy of this message | ||
I agree with Edwin on this one.
What's the <<< for??
Could it be you want to be doing this:
$templatestring = include("/pathto/email_template.php");
$message = "<<<HTMLMESSAGE".$templatestring."HTMLMESSAGE";
??
When you "include()" a file with PHP, it DOES parse the included file
(although in the included file, anything not between "<?php" and "?>" tags
will be considered plain text. Put another way: Even though the "include"
statement in the main document is ALREADY between PHP tags, the parser looks
for an opening PHP tag in the included file to find where to begin parsing -
anything before that opening tag is echo'ed out as plain text).
Hope this helps!
Take care,
--Noel
-------------------------------------------
"Daevid Vincent" <daevid@daevid.com> wrote in message
news:006801c2b88d$69748a60$0801a8c0@telecom...
> I've posted this a few weeks ago with no response. I want to use an
> external
>
> $message = <<<HTMLMESSAGE
> include("/pathto/customer_email.php");
> HTMLMESSAGE;
>