Jump to content

is it possible to assign a variable an include file?


darga333

Recommended Posts

[!--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');
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.