PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
pama
Forum Newbie
Posts: 12 Joined: Fri May 30, 2003 8:37 am
Post
by pama » Fri May 30, 2003 8:37 am
hi everyone,
anybody knows how to change view of $REMOTE_USER (NT) on the page?
I have
and on the page is "domain_name\\user_name". Is possible to show only "username"?
Thanks
stuart
Forum Newbie
Posts: 11 Joined: Thu Apr 24, 2003 8:14 am
Post
by stuart » Fri May 30, 2003 8:52 am
a quick, easy, answer would be to strip out the domain_name\\ part (if it exists) with regular expressions
pama
Forum Newbie
Posts: 12 Joined: Fri May 30, 2003 8:37 am
Post
by pama » Fri May 30, 2003 8:57 am
not possibile, but really easy
anyone?
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Fri May 30, 2003 9:07 am
Try
parse_url and Bob or whoever the user is, is your uncle
pama
Forum Newbie
Posts: 12 Joined: Fri May 30, 2003 8:37 am
Post
by pama » Fri May 30, 2003 9:23 am
maybe it's possibile, but...
1. i'm newbie
2. domain name is not url
3. i can't do it
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Fri May 30, 2003 9:33 am
Well you shouldn't need a regular expression for this,
explode() could do it:
Code: Select all
$info = explode('\'', $_SERVER['REMOTE_USER']);
$username = $info[1];
echo $username;
Mac
pama
Forum Newbie
Posts: 12 Joined: Fri May 30, 2003 8:37 am
Post
by pama » Mon Jun 02, 2003 12:46 am
twigletmac wrote: Well you shouldn't need a regular expression for this,
explode() could do it:
Code: Select all
$info = explode('\'', $_SERVER['REMOTE_USER']);
$username = $info[1];
echo $username;
Mac
hi, thanks for this code
i can use it but with one change, should be:
than i have username without domain name...
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Mon Jun 02, 2003 3:19 am
Not sure why it's $info[2] - you should only have 2 elements in the array but hey, if it works...
Mac