Okay so I posted about this in a similar topic but I don't think they got what I wanted because the script didn't work at all. I have an existing login script. It works with three pages: login, members, logout. There is a register page also but it is not related to the issue. The script provided is supposed to display the name of the logged in user in two instances: 1) when you log in it is supposed to tell you "You are now logged in *username here*! Continue to the members section(this would have been the link to members page)." 2) when on the member's page, it is supposed to display "You are logged in as *username*. Welcome *username*. Log out " ... but both pages do not display the names. There are three users. Can someone tell me why this script doesn't display usernames and how I can fix it, exactly, as I am a noob with php and have no idea how to get it done. The table created is called user, it has three rows: ID, username, and password ================================================================ Login ================================================================ Members ================================================================ Logout
You're trying to create a cookie with the $username variable, but I don't see where the $username variable is being set. Try adding this before your cookie code: $username = $_POST['username']; PHP: