"Daevid Vincent" <[EMAIL PROTECTED]> wrote: 
> I've posted this a few weeks ago with no response. 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 variables around that they need
> $username and $password (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
> ''include("/pathto/customer_email.php");'' instead of including the
> file. Grr.. (wouldn't it make sense that an include() should be parsed
> FIRST with the contents put in place basically? This seems like a 'bug'
> not a feature.

Well, include() will parse the file--maybe you're just doing it the wrong way... ;)

I'm not sure how your customer_email.php looks like but consider this:

  <?php

    $name = "General PHP";

    include "inc.php";

    echo $message;

  ?>

Then in inc.php you have:

  <?php

    $message = "$name, how are you doing?";

  ?>

Running the first script should echo:

  General PHP, how are you doing?

So, as you can see the $name was replaced.

Just a simple example...

- E

...[snip]...

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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

Reply via email to