DZ提供了一个API 但感觉用起来不方便。。正好自己也要研究DZ的结构
查找它需要用的函数 COPY过来 写了一段与DZ实现登陆的代码
<?
require './inc/config.php';
require './inc/func.inc.php';
$action=SafeRequest($_GET['action']);
//$GLOBALS['discuz_auth_key']='6cb20f469a265be0701e517a1772eca3';
//$discuz_auth_key = md5('PuJ3BGeRubtGFsr'.$_SERVER['HTTP_USER_AGENT']);
function authcode($string, $operation, $key = '') {
$key = $key ? $key : md5('PuJ3BGeRubtGFsr'.$_SERVER['HTTP_USER_AGENT']);
$coded = '';
//print_r($GLOBALS);exit;
//echo $key;exit;
$keylength = strlen($key);
$string = $operation == 'DECODE' ? base64_decode($string) : $string;
for($i = 0; $i < strlen($string); $i += $keylength) {
$coded .= substr($string, $i, $keylength) ^ $key;
}
$coded = $opera