I have a similar question/problem. However, I want to use an external
"email template" as it were, so that the sales guys can edit it as they
like and simply shuffle the three variables around that they need
$username, $password, $code  (either with or without the <?php ?> tags).

I don't want them mucking around in my code and potentially screwing it
up. Not to mention having a huge 'email' text in between those
HTMLMESSAGE markers is ugly as hell and ends up making the color-coding
in HomeSite all kinds of whack at the end of it.

I tried to use:

$message = <<<HTMLMESSAGE
  include("/pathto/customer_email.php");
HTMLMESSAGE;

But $message has the literal string instead of including the file. Grr..
(wouldn't it make sence that an include() should be parsed FIRST with
the contents put in place basically? This seems like a 'bug' not a
feature.

I also tried:

$filename = "/pathto/customer_email.php";
$fd = fopen ($filename, "r");
$message = fread ($fd, filesize ($filename));
fclose ($fd);

But all the $username, etc. are treated as literals and if I use
<?=$username?> in the customer_email.php the field is blank (like it's
being parsed but doesn't have a value for it or something), instead of
being converted to their actual PHP values. I also tried to put the
"global" keyword in the customer_email.php file at the top.

Is there no way to accomplish this?

> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
> 
> 
> Use a here-doc:
> 
> echo <<<EOB
> <br>[$data] <br> $titulo <br>($user)<br> $intro <br> $texto
> <br><br> (comentarios=$contador)<br><br><hr size=1 width=90%><br>
> EOB;


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to