Jump to content

Archived

This topic is now archived and is closed to further replies.

darga333

is it possible to assign a variable an include file?

Recommended Posts

ex.

$message = include('template.php');

then i can send the $message variable to the mail(); function

thank you!

darga333

Share this post


Link to post
Share on other sites
This is what you need:
$msg=file_get_contents(template.php);

[a href=\"http://www.php.net/manual/en/function.file-get-contents.php\" target=\"_blank\"]http://www.php.net/manual/en/function.file-get-contents.php[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=368949:date=Apr 26 2006, 02:54 PM:name=Orio)--][div class=\'quotetop\']QUOTE(Orio @ Apr 26 2006, 02:54 PM) [snapback]368949[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This is what you need:
$msg=file_get_contents(template.php);

[a href=\"http://www.php.net/manual/en/function.file-get-contents.php\" target=\"_blank\"]http://www.php.net/manual/en/function.file-get-contents.php[/a]
[/quote]

orio you are the man! thnx!!

[!--quoteo(post=368952:date=Apr 26 2006, 02:58 PM:name=darga333)--][div class=\'quotetop\']QUOTE(darga333 @ Apr 26 2006, 02:58 PM) [snapback]368952[/snapback][/div][div class=\'quotemain\'][!--quotec--]
orio you are the man! thnx!!
[/quote]

problem!! when i do that, it gets the file contents, but it doesnt include the php thats inside of it as an include would, any solutions?

[!--quoteo(post=368952:date=Apr 26 2006, 03:01 PM:name=darga333)--][div class=\'quotetop\']QUOTE(darga333 @ Apr 26 2006, 03:01 PM) [snapback]368952[/snapback][/div][div class=\'quotemain\'][!--quotec--]
orio you are the man! thnx!!
problem!! when i do that, it gets the file contents, but it doesnt include the php thats inside of it as an include would, any solutions?
[/quote]

what i mean by that is I have php variables inside that mail template, the variables in that mail template that i am including are determined by the file that i put the include statement in

for instance...

/* some php here *\

$message=file_get_contents('mailer_template.php');
echo $message;

... it just spits out the same $message
include works, but it wont let me assign a variable to it like this
$message = include('mailer_template.php');

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.