Jump to content

Where To Find Client/User id


hamzaavvan

Recommended Posts

Well this was a long way to go, and now my little project is on end but i'm confuse in one thing that how to retrieve client id or user id dynamically (which i'll concise like):

 

myaddress.com/admin/clientsdomains.php?userid=xx

 

Is there any function or any other way to get current client id(xx) because i tried finding it in GetNameservers() and i also looked in $_SESSION but didn't get any thing.

 

Thanks.

Edited by hamzaavvan
Link to comment
Share on other sites

yeah I'm confused now, looks like you are talking about admin area, but when I saw the URL example in first post I quickly assumed you are referring to client area.

 

in client area you could use:

$_SESSION['uid']

 

in admin area

$_REQUEST['userid']

 

that's it

Link to comment
Share on other sites

Thanks for this help, well i already know that i can access userid with

 

$_REQUEST['userid']

 

and with

 

$_GET['userid']

 

but my senior told me that this is not a good approach to retrieve userid (by the help of REQUEST superglobal variable),

so please guide me as i'm not so confident doing this, that either this way is good or bad. So that i'll let him know.

 

And one more thing that i can't access userid in client area by $_SESSION['userid'], please help me in pointing out this.

Am i doing something wrong ? OR

Is there some initial steps to get userid from

$_SESSION['userid']

 

Many Many Thanks !

Edited by hamzaavvan
Link to comment
Share on other sites

Is there any other way to retrieve userid from admin area ? Instead of $_REQUEST['userid']

use $_POST['userid'] or $_GET['userid'], if the userid exist in the address bar you should use $_GET otherwise $_POST will have the value if form were submitted.

 

$_REQUEST get the same value/var if it exist in $_GET or $_POST.

 

and It doesn't matter where the data comes from if it is not being handled in a secure manner.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated