Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 132239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:13:52+00:00 2026-05-11T06:13:52+00:00

I am writing a php script and somewhere before my header() function i have

  • 0

I am writing a php script and somewhere before my header() function i have printed text to the browser hereby causing my header() function give me a well known error:

Warning: Cannot modify header information – headers already sent.

Now my question is, I have the intentions of using ob_start() and ob_flush() before and after the header() function. But I once heard something like output buffer can affect the performance of one’s application negatively. How true is that?

Or should I just stick with the idea of printing Javascript function to redirect the page.

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:13:53+00:00Added an answer on May 11, 2026 at 6:13 am

    Using an output buffer requires the server to store the entire output of the PHP in RAM, so if it’s a large page, you’ll wind up using a fair amount of memory – and the server will also have to wait until the entire page is generated before sending it out, which could cause a small delay. But other than that, I don’t think there’s much of a disadvantage in using an output buffer. For what you want to do, it’s certainly a reasonable solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a PHP script and the script outputs a simple text file log
I was thinking of writing a PHP script that would analyse a CMS'd page's
In a PHP script I am writing, I need to send a control+z character
I'm writing a script in PHP that compares people together based on the number
I've been writing PHP for about six years now and have got to a
I've been writing PHP web applications for some time, and have come across very
I have been writting a keyword search script based on this tutorial: http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/ Like
I am writing PHP code where I want to pass the session id myself
I'm writing a PHP application with testability in mind, so my classes always ask
I'm writing a php app to access a MySQL database, and on a tutorial,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.