Display user's name after login

Discussion in 'PHP' started by whateveritis, Oct 25, 2010.

  1. sarah12

    sarah12 Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    28
    #21
    Check the attachment for complete file.. There is problem in posting reply
    1. <?php session_start(); ?> //start session
    After $Count..
    1. if($count==1){
    2. // Register $myusername, $mypassword and redirect to file "login_success.php"
    3. foreach($row=mysql_fetch_array($result)){
      $_SESSION["empName"] = $row[name];
    4. }
    5. $_SESSION["empID"] = $id;
    6. $_SESSION["empPass"] =$pass;


    NOW IN empHome.php file, you can display name:
    if(isset($_SESSION["empName"]))
    echo "welcome: ". $_SESSION["empName"] ;
     

    Attached Files:

    sarah12, Feb 12, 2013 IP