Hello, I am having some troubles with my PHP page. I have the user log in, and then I want it to say at the top of each page "Hello, <username>" but I am unsure on how to go about it. I was thinking maybe print " Hello " . $POST_[username] . "."; Code (markup): But on second thought, wouldn't that only work for one page? Would something to do with sessions work? Thanks for your replies, nodnil.
In this case, you cannot use $_POST to show the username in EVERY pages. You will have to call the cookie (or session, it depends on your login page).
you need cookie or session for doing this... try this code after you get your $_POST['username']; don'f forget call session function session_start(); $_SESSION['username'] = $_POST['username']; PHP: if you need call your username session on each page, you can do this session_start(); $username = $_SESSION['username']; echo 'Welcome back '.$username; PHP: