Hello, so I've a login system and everything. I'm trying to make it so if you are not logged in and you go to the home page it will have a UserName and Password bar at top, and if you are logged in when you visit the page then I want to make it have a "Welcome, username!" I've successfully got the code to make it do both of those functions nicely but I'm having a bit of trouble displaying information. The code I'm using has a basis like this: <?php if($session->logged_in) { ?> And right here I have the whole document to say <p>Welcome, <b><?php echo $session->username; ?></b>!</p> and then display a few links like edit account, log out and My Account, followed by the whole homepage. All this is inside html tags. <?php }else{ ?> And right here I have the whole document again but it's changed to display a username and password text field and not the account information if they're not logged in followed by the whole homepage. All this is inside html tags. <?php } ?> Code (markup): So here's my problem: When I go to the homepage to check it out LOGGED OUT, it will not display anything at all. If I goto the login page and login, then go back to the homepage while being logged in it will display all the information ($session->username, the links, all that stuff.) Any ideas? Sorry I'm trying to explain it really well.. If you need any code bits to help me out on this just say so I'll post what I can.
simple do like this: //PHP Code... if($session->logged_in) { //show: logged in info like welcome bla bla bla } else{ //show: you need to login form } //---------------------------------- after the if/else statement put the code of the rest of the page.