This topic is locked

How to get the user section id when logged in.

8/27/2020 10:47:03 PM
PHPRunner Tips and Tricks
S
skbrasil author

How to get the user section id when logged in.
I am developing a solution for affiliates, however on the page of advertising material I would like to obtain the current id of the user who is logged in.
the most you could do was just print the user's email, but instead of the email the user's real id is displayed
In my case it would be a code snippet
https://snarthost.com/aff.php?aff=$_SESSION["UserID"]
$ _SESSION ["UserID"] = real user id
the expected result would be this:
https://snarthost.com/aff.php?aff=1
Remembering that this id is dynamic according to the user's login

if login is user 2

the affiliate url is automatically displayed with the current section id
https://snarthost.com/aff.php?aff=2
I hope it was specific