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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:23:34+00:00 2026-06-01T17:23:34+00:00

I am writing a basic authorization system and I am struggling with it a

  • 0

I am writing a basic authorization system and I am struggling with it a bit. There are two files involved – index.php and login.php. The login form is pretty simple (it’s inside index.php):

<fieldset class="right">
    <label for="email">Email

        <input id="email" name="email" type="text" value=""/>
    </label>
    <label for="password">Password
        <input id="password" name="password" type="password" />
        <a href="#" onclick="$('#password-box').toggle();" >Forgot your password?<span></span></a>
    </label>
    <div class="btn-login"><button type="submit" value="Login"></button></div>
</fieldset>
</form>

The login.php contents:

<?php
//  Include the launcher file.
require_once('globals.php');
require_once(CORE . 'launcher.php');

//  Collect the information sent to us.
$mail = (isset($_POST['email'])) ? $_POST['email'] : '';
$password = (isset($_POST['password'])) ? $_POST['password'] : '';

$LoginError = false;
    // AUTHORIZATION STUFF HERE
if ($LoginError) {
    header('Status: 200');
    header('X-Test: test');
    header('Location: index.php');
    exit();
}

As you can see, I’m sending a custom header to the script containing the form in case there was an error during signing in. In the index.php, I’m using headers_list(), but the header I’m sending is not present in the list.

What is causing that? I’ve tried with php_value "output_buffering" "0" in the .htaccess file, but no success.

UPDATE
After checking in Chrome, the header is being received by the browser, but is not available in PHP.

Thanks in advance.

  • 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-06-01T17:23:35+00:00Added an answer on June 1, 2026 at 5:23 pm

    The redirect is sent to and processed by the client which responds by navigating to the given Location: index.php. You should not expect that the custom header is provided by the browser when it is requesting index.php from the server.

    CLIENT                                    SERVER
     |------- POST login.php ------------------>|
     |                                          |
     |<- 200, Location: index.php, X-Test:test -| (this is where you send the header)
     |                                          |
     |------- GET index.php ------------------->| (no header from client to server)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a basic push messaging system. A small change has caused it to
I'm writing a basic function in PHP which takes an input string, converts a
I'm writing a pretty basic application in python (it's only one file at the
I'm writing a basic crawler that simply caches pages with PHP. All it does
I am writing a basic jQuery form validation script and I have something like
I'm writing RESTful service with basic authorization. Here is what I do when no
I'm writing a basic message-script in PHP/MySQL but I'm stuck at a database query
Situation: I am writing a basic templating system in Python/mod_python that reads in a
I am writing a new authorization system and permission system for my multi tenant
Hey--I'm writing a basic Rails app that uses the digg API. I'm trying to

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.