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

  • SEARCH
  • Home
  • 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 6735635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:02:09+00:00 2026-05-26T11:02:09+00:00

<? echo lalala; header(Location: http://www.google.com/); If i put this in a plain php file

  • 0
<?
echo "lalala";
header("Location: http://www.google.com/");

If i put this in a plain php file and deliver over a standard apache2 server with mod-php (PHP Version 5.3.2-1ubuntu4.10) the redirect to google works.

<?
echo "lalala";
flush();
header("Location: http://www.google.com/");

this code does obviously not produce a working redirect.

My question is how the first code is beeing processed and why it works. Because I remember times when things like this were not possible. Is mod-php or apache intelligent enough to buffer the whole request and arrange headers before content?

And:

Can I rely on this if I make sure I don’t flush the output manually? Because it would make my application much easier…

  • 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. Editorial Team
    Editorial Team
    2026-05-26T11:02:10+00:00Added an answer on May 26, 2026 at 11:02 am

    Output buffering is probably enabled by default. You should enable it manually if you want to rely on this functionality.

    http://php.net/manual/en/function.ob-start.php

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

Sidebar

Related Questions

echo base64_decode(http://www.domain.com/en/messages/list?all=1); this gives the result: †Ыiяь0БЪ&j)ЬўoЮџщћІЖ zПеЉЛZ–] How to check if string is
I am using this: echo dirname(__FILE__); which gives: C:\UwAmp\www\myfolder\admin However I am looking for
echo (<div style=\text-align:center\> . include ('file.php') . </div>\n); I'm not sure why, but whenever
I invoked a php file by exec() doing this : <?php $cmd = php
I echo this : php> echo date(Y-m-d\TH:i:s); 2011-05-27T11:21:23 How can do with date function
echo '<p class=post><h3>'.$result['title'].'</h3><object class=video width=95% height=55%> <param name=movie value=http://www.youtube.com/v/'.$match[0].'?fs=1&amp;hl=en_US&rel=0> </param><param name=allowFullScreen value=true></param> <param name=allowscriptaccess
echo date(W,strtotime('2010-01-01')); This outputs 53. I would expect it to output 1. Can anyone
PHP Echo or Print functions does not show anything when php is busy with
I am sending the echo to mail function via PHP from variable that includes
in PHP echo (int) ( (0.1+0.7) * 10 ); or in Ruby p ((0.1+0.7)

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.