• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I get the userid from the url?

grantus

Active member
#1
I know how to get the userid of the member visiting, but what I'd like to know is how can I get the userid of a profile page?

For example, my userid here is 13867, if I go to someone's profile page and their userid is 15000, how do I get 15000? I need the userid, username, etc of the profile page that's being viewed.

Thanks.

Edit: sorry, this should be in a Xenforo area.
 

grantus

Active member
#3
No that's not what I meant. I'm doing a custom code for the profile page and I need to check what profile page is being viewed. This gives me MY information:

Code:
$object = XenForo_Visitor::getInstance();
$userid = $object['user_id'];
I need something like that, but for the profile page that is being viewed. I can fetch the URL with $_SERVER but I'd rather not.
 

Jake Bunce

XenForo moderator
Staff member
#6
There is a code example in the member controller:

Code:
		$userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);