unable to get $_SESSION variable

前端 未结 3 679
难免孤独
难免孤独 2021-01-12 04:56

\"this
In Log-in.php I have

  $email=$_POST[\'email\']; 
  $pass=$_POST[\'         


        
3条回答
  •  不要未来只要你来
    2021-01-12 05:33

    Sessions Step By Step

    1. Defining session before everything, No output should be before that, NO OUTPUT

      
      
    2. Set your session in a page and then you have access in that, for example this is page 1.php

      
      
    3. Using and Getting session in 2.php

       
      

    NOTE: Comments don't have output.


    Maybe answer to your question:

    I think you are not setting session, and because of that PHP doesn't know that session variable.

    Your login should be like this

      
    

提交回复
热议问题