SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: session

  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation session

    i am new to php and mysql. just i want to display the user id in all the pages when the user is login. i have created the session id for the user, i don't how to display the user id in all pages


    please any one help me and give the suggestion

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A quick example:
    login.php
    PHP Code:
    <?php
    session_start
    ();
    $user="matrix";
    $_SESSION['user']=$user;
    ?>
    <a href="main.php">go to main page</a>
    main.php
    PHP Code:
    session_start();
    echo 
    "Welcome ".$_SESSION['user']; 
    my mobile portal
    ghiris.ro

  3. #3
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Thanks Ernie
    Your code is useful for me
    Thanks a lot


Bookmarks

Posting Permissions

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