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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:59:13+00:00 2026-05-20T04:59:13+00:00

I followed this guide as an attempt to write a login script for my

  • 0

I followed this guide as an attempt to write a login script for my hobby webpage.

Problem is when I want to incorporate it into my page, problems occur.

I’m trying to make an admin panel.

In the top of the frame I want the login form to be

page example

When I log in, I’d like the Login form area to change into Logout fields.

My problem is that all cookie-related calls has to be done before the HTML code starts…

So:

  • When you log in: content of the page should be displayed ( a simple include ).
  • When you log in: login area changes into logout area, thus hiding the login fields and displaying name of user logged in…
  • and when logging out: content and logout should disappear and show login fields again.

How can this be done (give examples like pseudo code)?

PS. Im not a PHP nerd, still learning.

  • 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-20T04:59:14+00:00Added an answer on May 20, 2026 at 4:59 am

    You could write your login Data into your current session.

    $_SESSION["username"] = $user;
    

    But don’t forget to call session_start() at the top of your code.

    After that you check whether "$_SESSION["username"]" is set with your data. If so, you can change your content to whatever you like.

    Example:

    if (isset($_SESSION['username']) && loginSuccessful()) {
        include("AdminMenue.php");
    }
    

    loginSuccessful() should be a method that checks whether your Login Data can be found in your database.

    More information about sessions can be found here.

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

Sidebar

Related Questions

So I have followed This guide and used a simple printing python file. Problem
I followed this guide here perfectly and have gone through it again but when
I followed this guide: http://wiki.unto.net/setting-up-clojure-and-slime Which walked me through the steps of building Clojure
My site was working fine until I followed this guide, http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-9.10 to set up
I followed the git guide but I have this strange issue when trying to
I followed this guide http://lazyfoo.net/SDL_tutorials/lesson03/windows/codeblocks/index.php to set up the sdl image extension but now
I followed this guide which I was recommended , but I can't get it
I followed some tips in this guide: JTable with horizontal scrollbar but still having
I have followed the steps of this guide to install objectaid on eclipse GALILEO
I have been using this guide http://tinyurl.com/mercurial-iis to attempt to setup Mercurial on IIS

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.