Here is an easy way to log in directly using Discuz's include/common.inc.php.
Copy CodeThe 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", "R" Eserved_arr ");
foreach ($GLOBALS as $key = $value)
{
if (!in_array ($key, $reserved _arr))
{
Unset ($GLOBALS [$key]);
}
}
Unset ($reserved _arr, $value);
Put the above code at the beginning of any program, with the intention of not affecting the use of custom variables. This will read the login information into the $ctdf_userinfo array.
Or this is relatively simple oh, looking for a long time, this time is cool
http://www.bkjia.com/PHPjc/322759.html www.bkjia.com true http://www.bkjia.com/PHPjc/322759.html techarticle here is an easy way to log in directly using Discuz's include/common.inc.php. Copy the code code as follows: Include_once (".. /discuz/include/common.inc.php "); $CTDF _userinfo ...