session in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prashant55
    New Member
    • Sep 2008
    • 1

    #1

    session in php

    why do i get an error when so ever i use a seesion in php coding???/why do session is not set.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Post the code you used. Hopefully you were referring to a manual when you wrote the code.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Also post the error message you receive.

      Comment

      • maheswaran
        New Member
        • Mar 2007
        • 190

        #4
        Check whether u start the session (session.start)

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by maheswaran
          Check whether u start the session (session.start)
          You mean session_start() .

          Comment

          • maheswaran
            New Member
            • Mar 2007
            • 190

            #6
            yes you said right..If not include session_start() then not set on that page..

            Comment

            • miraan
              New Member
              • Apr 2008
              • 24

              #7
              this is what u need to do.

              Code:
              <?php
              session_start(); //Make sure this is right at the top
              $_SESSION['example']="Example"; // Now you can use this variable, or if you have set it from before then you dont have to do this.
              $example=$_SESSION['example'];
              echo $example;
              ?>
              Ill be happy to help you if you need more help.

              Comment

              Working...