Forum Moderators: coopster

Message Too Old, No Replies

file get contents()

allow_url_fopen

         

henry0

7:45 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to verify:
(working on the HTML section of a mailer)
If in my php.ini: allow_url_fopen is On
Will file_get_contents(file URL)
called as follow
$mailer->Body = str_replace('{MEMBER_NAME}', $member_name, file_get_content($htmlBody) );
allows the file to become my email body? where $htmlBody comes from the DB

I pass on the details :)

StupidScript

9:18 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep. file_get_contents() reads the file into a string, and a string is what you want to use in your email. You should use urlencode() if there are special chars (spaces, etc.) in the URL you are using to point to the file.

henry0

10:02 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, then it should work
but I forgot about the special char
which I will need since it wil point to a tpl