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 5929739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:27:52+00:00 2026-05-22T14:27:52+00:00

I use header Location across my site and there was no problem. I then

  • 0

I use header Location across my site and there was no problem. I then added a language (French) and had to save my files in Unicode UTF 8 including BOM elements…

Now my header location doesn’t work anymore…the weird part being that there is no error message displayed…

So I updated my function to display a self made error message…see below

function redirect_to( $location = 'index.php'){
// code reached, error_reporting test

#flush();

if (headers_sent()) { 
    echo 'Debug: would send location header ', $location, $unsetVariableTriggeringWarning;
    die('cannot send location header (anymore)');
}
else {
  header('Location: '.$_SESSION['base_url'].$location);
  die();
}   

}

And I do get the error message now:

Debug: would send location header access.php?redirecto=accountcannot send location header (anymore)

But nothing has been printed out yet, no HTML, no PHP, no nothing. So my best guess was when I converted to Unicode utf8, there must of been something that happened. So I switched back, but still, the error persists…

Any help, much appreciated.

  • 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-22T14:27:52+00:00Added an answer on May 22, 2026 at 2:27 pm

    The PHP engine does not consume the BOM that would be before the <?php in the script, so it will be sent out as usual. Remove the BOM.

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

Sidebar

Related Questions

I was trying to use this code: if($_SERVER['HTTP_PORT'] !== 443 && !isset($_SERVER['HTTPS'])) { header('Location:
I am using Visual Studio 2008, and I need to use certain header files
I'm wondering if I can use the header(Location: someFile.php); from a script that is
I recently came across a server that's sending a Location header (for a redirect)
For a banner management system i use a header(Location: http://www.awebsite.com); to redirect to the
How can I use my .htpasswd login session all across my site? I want
How do I properly use header function, so header(location: http://.$_SERVER['HTTP_HOST']./?para=abc); //for http and header(location:
How do I use the header redirect to make it redirect to the current
Is it possible to use multiple header types in one document? For example: header(Content-type:
I'm trying to use the header() function to create a redirect. I would like

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.