www.webdeveloper.com
Results 1 to 3 of 3

Thread: Set a value in session ?

  1. #1
    Join Date
    Sep 2013
    Posts
    22

    Set a value in session ?

    How to set a value in session ?

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    792
    Hi lara123,

    PHP Code:
    <?php

        session_start
    ();
        
    $_SESSION['name'] = 'value';
        
    ?>
    session_start sends header information to the client, so call it before outputting anything.

    http://php.net/manual/en/ref.session.php
    JavaScript: Learn | Validate | Compact | bionoid

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    Try out with the below example code:

    <?php

    /* set the session name to WebsitePHP */

    $previous_name = session_name("WebsitePHP");

    echo "The previous session name was $previous_name<br />";
    ?>

    Hope this helps.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles