Hello, supose you are on a user page, in this case the user page with 'uid'=3

So your navigation bar looks like this:
http://www.yoursite.com/user/3

What would be the code for the 'uid' number of the user page you are visiting(in this example '3')?

Comments

baronmunchowsen’s picture

You could grab the uid in this case by using

$current_uid = arg(1);

Is this what you mean?

for example give the url: http://www.example.com/user/6/edit

arg(0) = user
arg(1) = 6
arg(2) = edit

mortenson’s picture

Yes, thanks baron!

I actually need it for a default value on a field.