Forum Moderators: coopster

Message Too Old, No Replies

What is wrong with my file get contents?

Could not figure it out - scripting error?

         

henry0

6:41 pm on May 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if in the database I insert a simple HTML tpl
I have no problem to get it WITHOUT using file_get_content()
$mailer->Body = str_replace('{MEMBER_NAME}', $member_name, $htmlBody);
$htmlBody is the "go getter"

But when I feed the DB with the path to the same tpl that is now set at my application root level.
and with the file path loaded in the DB I cannot get it to open
and get :
Warning: file_get_contents("http:// etc....sample.html") [function.file-get-contents]: failed to open stream: No such file or directory in....
ALTHOUGH IF I USE THE "ERROR PATH" AND PASTE IN MY BROWSER THEN IT WORKS!
So we know that the path is ok
I use this with file_get_contents()
$mailer->Body = str_replace('{MEMBER_NAME}', $member_name, file_get_contents($htmlBody) ) ;

what is my mistake
knowing that allow_url_fopen in On

henry0

8:28 pm on May 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Disregard
I had a double quote " " in the DB URL

eelixduppy

8:35 pm on May 23, 2007 (gmt 0)



Just imagine if us programmers had a dollar for each time there was a problem with quotes ;)

Glad you resolved the issue!

whoisgregg

9:38 pm on May 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it was semicolons, I'd be a millionaire by now. :)

henry0

10:56 pm on May 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



me too:
";" mostly forgeting it after an echo!