Here's a simple way to log in directly using Discuz's include/common.inc.php.
Copy Code code 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", "R Eserved_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 to not affect the use of custom variables. This reads the login information into the $ctdf_userinfo array.
Or this is relatively simple oh, look for a long time, this time it's cool