How do I get the userid from the url?


Active member
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.


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


Active member
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:

$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
There is a code example in the member controller:

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