Php to obtain the implementation code of Discuz forum login user name, user group, user ID and other information. Here is a simple method to log on directly using discuz's includecommon. inc. php. Copy the code as follows: include_once (.. discuz?decommon. inc. php); $ CTDF_USERINFO here is a simple method to log on directly using discuz's include/common. inc. php.
The code is as follows:
Include_once ("../discuz/include/common. inc. php ");
$ CTDF_USERINFO = array ();
$ CTDF_USERINFO ["sid"] = $ sid;
$ CTDF_USERINFO ["uid"] = $ discuz_uid;
$ CTDF_USERINFO ["user"] = $ discuz_user;
If ($ discuz_uid = 0)
{
$ CTDF_USERINFO ["user"] = "guest _". $ sid;
}
$ CTDF_USERINFO ["groupid"] = $ groupid;
/**
* Clear discuz variables
*/
$ Reserved_arr = array ("GLOBALS", "_ POST", "_ GET", "_ COOKIE", "_ FILES", "_ SERVER", "_ ENV ", "_ REQUEST", "CTDF_USERINFO", "reserved_arr ");
Foreach ($ GLOBALS as $ key => $ value)
{
If (! In_array ($ key, $ reserved_arr ))
{
Unset ($ GLOBALS [$ key]);
}
}
Unset ($ reserved_arr, $ value );
Place the above code at the beginning of any program, so as not to affect the use of custom variables. In this way, the logon information is read to the $ CTDF_USERINFO array.
It's still relatively simple. I 've been searching for a long time and it's so nice this time.
Bytes. The code is as follows: include_once ("../discuz/include/common. inc. php"); $ CTDF_USERINFO...