> What I'm trying to do is specify a URL in a form, and then take that URL,
> put its contents into a variable, and mail it out in an e-mail message
with
> the body of the message being that URL.  I haven't gotten anywhere so far,
> just getting blank messages for the body..   can anyone point me in the
> right direction on saving the contents of a page to a variable?  I've ran
> across a few examples, but nothing has worked for me yet. :(
>
> Thanks,
> Chad
>

try using output buffering.  In a php script put the following:

ob_start(); //everything following will be stored for output.

include 'your_page.php';

$body=ob_get_contents(); //store everything in output in $body variable

Then mail as usual.  Your page will be the $body variable.  If you want to
display the page as well use ob_end_flush().  If you just want to mail the
page use ob_end_clean() to clear the output buffering and continue scripting
for normal display.

check out http://www.php.net/manual/en/ref.outcontrol.php for more
information on output buffering.  If you are still stuck email me off list
and I will send you a sample of a file that does the same thing for me.

Brett


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to