session problem in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bernouli
    New Member
    • Oct 2012
    • 26

    session problem in php

    i have written a login form but
    now my welcome page displays error

    Notice: Undefined variable: session in C:\xampp\htdocs \signup-login\welcome.p hp on line 18

    welcome.php

    Code:
    <?
    
    include "include/session.php";
    ?>
    <!doctype html public "-//w3c//dtd html 3.2//en">
    
    <html>
    
    <head>
    
    
    <meta name="GENERATOR" content="Arachnophilia 4.0">
    <meta name="FORMATTER" content="Arachnophilia 4.0">
    </head>
    
    <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
    <?
    echo "<center><font face='Verdana' size='2' >Welcome userid=$session[userid]<br><br></font>";
    
    ?>
    
    
    </body>
    
    </html>
    my problem lies here
    Welcome userid=$session[userid]
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    What is in session.php?

    Did you try

    Code:
    <?php session_start(); ?>
    at the start of the page?
    Also if we are talking about the PHP session then I'd expect the syntax to be $_SESSION['userid']

    Comment

    • bernouli
      New Member
      • Oct 2012
      • 26

      #3
      The error says Notice: Undefined variable: session in C:\xampp\htdocs \signup-login\welcome.p hp on line 18.
      please how do i define variable session

      thank u

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Did you read my reply at all?

        Comment

        • bernouli
          New Member
          • Oct 2012
          • 26

          #5
          yes but the error persisted displaying
          Undefined variable: session
          i we need to define variable session

          Comment

          Working...