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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:57:17+00:00 2026-06-06T18:57:17+00:00

What is wrong with this login script? I have a modal-style iframe login box

  • 0

What is wrong with this login script? I have a modal-style iframe login box which is /login.php and I have a /index.php.

After logging in, the login.php redirects to the index.php, but I don’t see the username. just Hello Guest. When I try to login it says you, username, are already logged in.

login.php:

<?php session_start(); require_once('connections/Main.php');

if(isset($_SESSION['username'])) {

    echo '<div class="error_message">Attention! You, '.$_SESSION['username'].' are already logged in.</div>';
    echo "<br />";
    echo "Go <a href='javascript:history.go(-1)'>back</a> to the page you were viewing before this.</li>";

    exit();
}
?>

index.php:

<?php session_start(); 
   require_once('connections/Main.php'); 
     ?>

<div> Hello <?php   if(isset($_SESSION['username'])) { 
          echo $_SESSION['username']; }
                    else{ echo 'Guest'; } ?></div>
  • 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-06T18:57:18+00:00Added an answer on June 6, 2026 at 6:57 pm

    start your session with this.

    $_SESSION["im_going_in"]=true; 
    $_SESSION["username"]=$username;//get data from db.
    

    index.php

    <?php
    if($_SESSION["im_going_in"]) {
    ?>
    
      <?=strtoupper($_SESSION["username"])?>// welcome dear bla bla...
    
    <?
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone see anything wrong with this login script: public function login($username, $pass, $remember)
I have this jQuery script that sends a username an password to a PHP
On my website I have a PHP script which (when user enters a username
I have this login script, but for some reason its not working. I checked
I have writing some changes at index.php and index_form.php to login in my mambo
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once db_login.php
I am working on my first login script. I have been following examples from
I have another script that I can't figure out what is wrong with it.
I use this Facebook Login Button code: <div id=fb-root></div> <script src=http://connect.facebook.net/en_US/all.js></script> <script> FB.init({ appId
I have this code to log people in with Facebook: <div id=fb-root></div><script src=http://connect.facebook.net/en_US/all.js#appId=my_app_id&amp;xfbml=1> </script><fb:login-button

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.