Welcome Guest, Not a member yet? Register   Sign In
How to display corpname first, if no corpname, then username?
#3

(01-19-2021, 09:21 AM)paulbalandan Wrote:
PHP Code:
<?php echo $this->session->userdata('corp_name') ?: $this->session->userdata('user_name'); ?>

This works on the assumption that both session data returns strings, and if 'corp_name' is not given it will return an empty string.

Thanks @paulbalandan, but that doesnt work. The way Im testing is to log in with username then go to corporations and log in with a corpname, then go to an advert page which displays the corpname. That displays the corpname as it did before. But then I log in again with username then go to the advert page and the corpname still displays. We dont want that. We want the username to be displayed. In other words the 2nd part of your coding has no effect.
Reply


Messages In This Thread
RE: How to display corpname first, if no corpname, then username? - by christaliise - 01-19-2021, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB