phreak3r Posted January 15, 2018 Share Posted January 15, 2018 Hi there PHPFreaks, phreak3r is back for the second time today! I have been trying to figure out how to implement a minor change here. When the user is not logged in, the nav bar will display Register/Login, that has already been accomplished. When the user is logged in, the nav bar should display logout. I am trying to figure out how to best go about doing that. Suggestions are greatly appreciated, thank you! Link to comment Share on other sites More sharing options...
requinix Posted January 15, 2018 Share Posted January 15, 2018 logout stuff login stuff Link to comment Share on other sites More sharing options...
phreak3r Posted January 15, 2018 Author Share Posted January 15, 2018 <?php if (user is logged in) { ?> logout stuff <?php } else { ?> login stuff <?php } ?> Yes, I have done that, but at the top of each page I include a header file with Register|Login in the navbar. I want to figure out how to dynamically change it when the user is logged in. The process of checking if the user is logged in or not takes place in another file separate from the header file. What you've provided me above is already in my script. Link to comment Share on other sites More sharing options...
requinix Posted January 15, 2018 Share Posted January 15, 2018 I assume either you're asking for a way to violate causality, or you're waiting for someone to tell you that you have to rearrange your code. Link to comment Share on other sites More sharing options...
phreak3r Posted January 15, 2018 Author Share Posted January 15, 2018 I assume either you're asking for a way to violate causality, or you're waiting for someone to tell you that you have to rearrange your code. Ahaha, quite the comedian, I assume so. Well, thank you!? Sorry for taking up valuable space with this thread, feel free to delete it. Link to comment Share on other sites More sharing options...
phpmillion Posted January 15, 2018 Share Posted January 15, 2018 Yes, I have done that, but at the top of each page I include a header file with Register|Login in the navbar. I want to figure out how to dynamically change it when the user is logged in. The process of checking if the user is logged in or not takes place in another file separate from the header file. What you've provided me above is already in my script. In this case, simply repeat the same logic in your header file (you can do if logged_in... else... stuff an unlimited number of times in different files) Link to comment Share on other sites More sharing options...
phreak3r Posted January 15, 2018 Author Share Posted January 15, 2018 In this case, simply repeat the same logic in your header file (you can do if logged_in... else... stuff an unlimited number of times in different files) Thanks, but 'tis this is no longer an issue, I've done it dynamically. Thank you for the help though! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.