Inserting External HTML into Variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mlarson154
Forum Newbie
Posts: 15
Joined: Tue Apr 11, 2006 3:00 pm

Inserting External HTML into Variable

Post by mlarson154 »

I have a by-weekly newsletter to which I am trying to add a "forward to a friend" form. What I want to do is include the full HTML newsletter into the notice for the friend, but I'm having trouble getting it to insert correctly. I'm using ob_start(); to attempt this. The following is my code:

Code: Select all

 
ob_start();
    include "urlexample.htm";
    $newsletter_html = ob_get_contents();
ob_end_clean();
 
I have also used ob_get_clean();, but neither are giving me the HTML output from the url.
I have inserted a link via this method and the link itself will show up in the email, but if I try to include the html, it won't. So, I know that the ob_ processes are functioning correctly.
I've checked my "output_buffering" setting in my php.ini file and it is turned on.

Any thoughts?
Post Reply