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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:51:29+00:00 2026-05-22T15:51:29+00:00

within my login code (index.php) there is a section for facebook login. it checks

  • 0

within my login code (index.php) there is a section for facebook login. it checks whether or not the user has been logged in. now i can’t use headers to redirect the user to a different page because it produces the error

Warning: Cannot modify header information - headers already sent by

(output started at
C:\xampp\htdocs\kite\index.php:81) in
C:\xampp\htdocs\kite\index.php on line
196

so as a result i’ve resorted to using to meta-refresh

    <?php 
                //if user is logged in already
                if ($user): ?>
                <?php 
                //redirect them to the user sonline page
echo '<META HTTP-EQUIV="Refresh" Content="1; URL=main.php">'; 
                //if user is not logged in
                else: ?>
                <input name="fblogin" type="button" value="Login with Facebook" class="fblogin" onclick="location.href='<?php echo $loginUrl; ?>'"/>
                <?php endif ?>

what are the advantages and disadvantages of this method?

thanking you in advance


all i have on line 81 is

<?php // include the hashing class  
require ("resources/phpass/PasswordHash.php"); 
  • 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-22T15:51:30+00:00Added an answer on May 22, 2026 at 3:51 pm

    In login and logout context, header() will stop the browser from caching the page, which stores some sensitive information of the user.

    You need to send header BEFORE any of your HTML will be displayed.

    There are some more reasons behind header(), to make it preferable to the developers. But in login context, I think that’s enough.

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

Sidebar

Related Questions

I am creating quite a complex web application. I like to use php to
I've heard from a friend that the WWW-Authenticate header can be explicitly defined within
I have been using the Learning Java 2nd Edtion book to try make my
I would like to make sure that when user log in it will stay
I'm using declarative J2EE form based authentication in my webapp, following the instructions given
I'm using Devise 1.3.4 for authentication for the backend in my app. For a
I need to do a few db things and I would rather have extension
ok, so i am trying to replicate this animation at the top of this
Hello developers and designers, I am very willing to learn WPF in which i

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.