$_SESSION values not holding!

前端 未结 5 630
轮回少年
轮回少年 2021-01-22 03:18

I\'m writing a user login system, and I (like so many others) am having a problem with my sessions.

Here\'s the pointer from the login script when the inputs are validat

5条回答
  •  隐瞒了意图╮
    2021-01-22 03:43

    First of all, please enable debugging:

    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    

    Second, session_start() needs to be at the top of the page. So the line you wrote;

    You are logged in as: 
    

    will never work.

    The following line needs to be on top of the page, before any HTML etc.

    
    

提交回复
热议问题