I typically use the PHP output buffer to either change the output going to a page, or retrieve the output and direct it to a file.

For example, consider the following:

  1. // start buffering the output
  2. <?php
  3. // echo a possible mysql_error if it exists
  4. // get the buffered output and clean/stop the buffering
  5. $buffered_output = ob_get_clean();
  6. // save the output to a logfile - append if file exists
  7. file_put_contents("mysql.log.txt",$buffered_output,FILE_APPEND);
  8. ?>
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • blinkbits
  • BlinkList
  • blogmarks
  • BlogMemes
  • Blogosphere News
  • Blogsvine
  • blogtercimlap
  • Blue Dot
  • Bumpzee
  • co.mments
  • connotea
  • De.lirio.us
  • description
  • description
  • eKudos
  • Fark
  • feedmelinks
  • Fleck
  • Furl
  • Global Grind
  • Gwar
  • Haohao
  • HealthRanker
  • Hemidemi
  • Internetmedia
  • kick.ie
  • laaik.it
  • LinkaGoGo
  • LinkArena
  • Linkter
  • Live
  • Ma.gnolia
  • Meneame
  • MyShare
  • N4G
  • Netvouz
  • NewsVine
  • NuJIJ
  • PlugIM
  • description
  • Pownce
  • ppnow
  • Propeller
  • RawSugar
  • Rec6
  • Reddit
  • SalesMarks
  • Scoopeo
  • description
  • Segnalo
  • Shadows
  • Simpy
  • Sk-rt
  • Slashdot
  • Smarking
  • Socialogs
  • SphereIt
  • Spurl
  • StumbleUpon
  • Taggly
  • TailRank
  • Technorati
  • ThisNext
  • TwitThis
  • Webride
  • Wikio
  • Wists
  • Wykop
  • Xerpi
  • YahooMyWeb
  • Yigg
Leave a Reply

You must be logged in to post a comment. Login »