hamzaavvan Posted September 4, 2016 Share Posted September 4, 2016 (edited) 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 September 5, 2016 by hamzaavvan 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 4, 2016 Share Posted September 4, 2016 when user is logged in use $_SESSION['uid'] 0 Quote Link to comment Share on other sites More sharing options...
hamzaavvan Posted September 5, 2016 Author Share Posted September 5, 2016 Sorry didn't get you and i already added that $_SESSION is not helping me. As i'm already in clientdomains page with userid 1, so why should i check for logged in ? Doesn't make sense. Please will you go in explanation ? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 5, 2016 Share Posted September 5, 2016 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 0 Quote Link to comment Share on other sites More sharing options...
hamzaavvan Posted September 5, 2016 Author Share Posted September 5, 2016 (edited) 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 September 5, 2016 by hamzaavvan 0 Quote Link to comment Share on other sites More sharing options...
hamzaavvan Posted September 5, 2016 Author Share Posted September 5, 2016 Ok Ok Thank you so much now i got you, actually the mistake was mine but i have just one more query, that Is there any other way to retrieve userid from admin area ? Instead of $_REQUEST['userid'] If there is so please do tell me Once again Thanks ! 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 5, 2016 Share Posted September 5, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.