UPDATES VIA   RSS  |  Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP:ob_start() Display page …

PHP:ob_start() Display page at once, forget about cookie,headers sent too early errors

Posted on 21. Aug, 2009 by in Coding, PHP

If you want to display your web pages at once, not subsequently, and reduce the “headers already sent, cannot send cookie information” errors, add ob_start() at the start of your script.

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. (php.net)

You can also manipulate the contents of the output by using the function ob_get_contents()

Translate this post
                    
                    

Related posts:

  1. PHP: How to download a webpage (aka web scrapping) with PHP
  2. WordPress: Best SEO iTranslator for WordPress, get free traffic from fully automated plugin script
  3. Coding:How to fetch user profile data with SSI.php from a SMF forum database
  4. JavaScript: Send function as a parameter to another function (callbacks)

  • Hakanyalcin

    Tüm
    dünyadaki okey oyuncuları ile aynı platform içerisinde sohbet ederek canlı okey
    oynamaya hazır olun. http://www.okey-oyna.com sizi eğlenceye ve heyecana davet ediyor. İnternette görüntülü
    olarak okey oyna, gerçek kişilerle tanış, turnuva
    heyecanını yaşa. Dünyanın en büyük internet oyun portalı içerisine kayıt olun
    ve oynamaya hemen başlayın.