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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:16:02+00:00 2026-05-25T17:16:02+00:00

Say I have a form where the user can sign in, and when the

  • 0

Say I have a form where the user can sign in, and when the user fills out the form it posts back to the same page, checks for errors with the username and password, and logs the suer in if all is swell. At the moment I’m doing this by loading the form under this condition:

if($_SERVER['REQUEST_METHOD'] != 'POST') {

and if this isn’t true then check for errors and log in etc.

The problem is that this all happens in signin.php. At the top of signin.php I am including header.php and connect.php, which do exactly what their names suggest. When I post back to the page the changes in sign in status are not shown in the header file (there is a userbar in this file, similar in nature to the one on this site). The sign in works, but I have to navigate to a different page for the header to show ‘signed in’ instead of ‘sign in/register’ or whatever.

Have I gone about this in the wrong way, or is there just something I need to add to make my header update? Cheers.

P.S: I am pretty new to php so something not too complicated would be preferable please.

  • 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-25T17:16:03+00:00Added an answer on May 25, 2026 at 5:16 pm

    there are 2 problems with your setup violating very basic yet strict rules of the web-development

    1. There ought to be redirect after any POST request. Can be done as shown in the other answer.
    2. There must be no HTML shown before all logic is done. So, your header.php should be called AFTER form checking, not before it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form where user can select search criteria. The criterias are say:
Say we have a form where the user types in various info. We validate
Let's say I have an user registration form. In this form, I have the
Let's say I have a form where users can search for people whose name
I have a form that the user fills and is then directed to a
Let's say I have a form for adding/editing products (with field 'user' being a
I have a django app where user can submit a form .I have put
I have a page upon which a user can choose up to many different
Say I have a login form in CodeIgniter -- I can set validation rules
Lets say we have a web page with a search input form, which submits

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.