Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture browser results? 1

Status
Not open for further replies.

wendyp

IS-IT--Management
Mar 4, 2003
51
US
I am sending an HTML formatted email message. I have a database results page that PHP outputs with imbedded images. I know I can go back into my (very complicated) code and everywhere I write HTML, I can also write the same to a variable - but isn't there an easy way to just "catch" everything that's heading to the browser?

Currently, I can get the result page, save it manually, edit the path names for the images back to the original and then send the file in HTML format - no troubles with the mailing.

I can also capture some of the HTML into a variable and send that - no troubles there.

If I can't catch my output on its way to the browser, then I will have to go into my header, my content, my database results, my footer and write PHP to catch everything into a variable. I'm just hoping there's an easier way.

Thanks,
/Wendy
 
If I get you correct you want to see the HTML tat would goto the browser and perhaps manipulate it?.
You can read the output buffer which may be what you want, e.g.
Code:
<?php
ob_start();
echo "hello";
$buff = ob_get_contents();
echo "buff is " . $buff;
<?
Just play around with (in my example) $buff

 
Thank YOU! I thought there had to be a simple way to do it. That was what I was looking for and I couldn't find it. It worked perfectly! I was able to create the page, grab a copy of the buffer for my email and send it.

You get a star for that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top