Search Results

Search found 1 results on 1 pages for 'lulzim'.

Page 1/1 | 1 

  • Session in php are not enough clear to me

    - by Lulzim
    I find sessions in php kind of confusing, can anybody of you explain those to me. I have an example which is not working in my case: I register sessions this way, would you please tell me is this the right way of registering sessions //this is the page from where i register myusername in sessions if($count==1){ session_start(); $_SESSION['myusername'] = $_POST['myusername']; include("enterpincover.php"); } else { echo "Wrong Pin"; } here i check first whether the username is registered in sessions in oder to open his account , otherwise open again login. It works, if user is not loged in, it will show login page which is right, if user is loged it shows welcome message but not the Welcome the name of the user as I want. for ex: Welcome David <?php session_start(); if(isset($_SESSION['myusername'])) { echo 'Welcome '.$_SESSION['myusername']; } else { include("leftmodules.php"); include("rightmodules.php"); include("login.php"); } ?>

    Read the article

1