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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:20:19+00:00 2026-06-09T13:20:19+00:00

I made a simple login and registration system, and I used sessions to display

  • 0

I made a simple login and registration system, and I used sessions to display the username to the user, just for practice.
It all works fine in the registration page, and I can register users, but when I try to login, it displays a blank page, Instead of what it is supposed to do, which is displaying ‘Login success’ and redirecting me to ‘index.php’, setting my $_SESSION and in the ‘index.php’ I use the session to display information about the user.
The problem starts with that I’m not logged in after I insert the correct information in the form. This code worked great on my previous hosting service, but it had his problems.
This gets weirder when my friend can login to my account but I can’t login.
So this is where is the ‘Login success’ part:

    else if ($login === true)
        {
            include 'include/aside.php';
            include 'include/footer.php';
            $id = id_from_username($username);
            $_SESSION['id'] = $id;
            redirect('index.php','2'); // a replacement for header()
            echo 'Login Success.';
            exit();  
        }

Here is the check if the user is logged in:

if(isset($_SESSION['id']))
{
    return true;
}
else 
{
    return false;
}

This is the login query:

function login($username, $password) {
$username = mysql_real_escape_string($username);
$password = md5($password);
$loginquery = mysql_query("SELECT id FROM `users` WHERE `username` = '$username' AND `password` = '$password' LIMIT 1");
return (mysql_num_rows($loginquery) == 1);}  

And yes, I use session_start(); at the start of each page.
I tried this with Mozilla firefox, Google chrome and IE6, none of them worked.
If you need more information, just tell me.

So why can’t I login?

Thanks a lot.

(Oh, and excuse me for my english)

  • 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-09T13:20:20+00:00Added an answer on June 9, 2026 at 1:20 pm

    Try replacing the include() statements with echo "success";. This will let you know if the failure is in one of those files, or possibly with the file path / permissions.

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

Sidebar

Related Questions

I made a simple login form where a user can click on a register
last year I made really simple blog system. it allows user to authorize, posting,
I made a really simple login and session structure for reuse in my future
I'm having a problem with a simple html login page I made, where when
so I made a simple user log in website, and I want to set
so I'm making some basic programming language (just for exercise). I've made simple grammar
I made the simple j2me login application, code is below. It's working perfectly on
I have a Razor site I made with full login/registration and Admin roles with
Its a simple login form that I have made using Classic ASP, where the
I have a simple Login page made with JSF 2.0. Usually in every login

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.