當前位置: 首頁>>代碼示例>>PHP>>正文


PHP misc::GetCookie方法代碼示例

本文整理匯總了PHP中misc::GetCookie方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::GetCookie方法的具體用法?PHP misc::GetCookie怎麽用?PHP misc::GetCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc的用法示例。


在下文中一共展示了misc::GetCookie方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: verifyTiezi_send

function verifyTiezi_send($uid, $tid, $pid, $water = 'StusGame Tieba Cloud Sign Plugin "verifyTiezi"', $device = 4)
{
    if (empty($uid) || empty($tid) || empty($pid)) {
        return array('status' => '1', 'msg' => '');
    }
    $ck = misc::GetCookie($pid);
    $xs = verifyTiezi_gettie($tid, $ck);
    $x = array('BDUSS' => $ck, '_client_id' => 'wappc_136' . rand_int(10) . '_' . rand_int(3), '_client_type' => $device, '_client_version' => '5.0.0', '_phone_imei' => md5(rand_int(16)), 'anonymous' => '0', 'content' => $water, 'fid' => $xs['fid'], 'kw' => $xs['word'], 'net_type' => '3', 'tbs' => $xs['tbs'], 'tid' => $tid, 'title' => '');
    $y = '';
    foreach ($x as $key => $value) {
        $y .= $key . '=' . $value;
    }
    $x['sign'] = strtoupper(md5($y . 'tiebaclient!!!'));
    $c = new wcurl('http://c.tieba.baidu.com/c/c/post/add', array('Content-Type: application/x-www-form-urlencoded'));
    /* //Note:普通的
    	$x = verifyTiezi_gettie($tid,$ck);
    	$c = new wcurl('http://tieba.baidu.com'.$x['__formurl']);
    	unset($x['__formurl']);
    	$x['co'] = $water;
    	*/
    $c->addcookie('BDUSS=' . $ck);
    $return = json_decode($c->post($x), true);
    $c->close();
    if (!empty($return['error_code']) && $return['error_code'] != '1') {
        return array('status' => $return['error_code'], 'msg' => $return['error_msg']);
    } else {
        return array('status' => '1', 'msg' => '');
    }
}
開發者ID:noinlijin,項目名稱:tiebaSign,代碼行數:29,代碼來源:verifyTiezi_cron.php

示例2: cron_wmzz_zan

function cron_wmzz_zan()
{
    require_once SYSTEM_ROOT . '/plugins/Cloud_Click/zan.php';
    $set = unserialize(option::get('plugin_Cloud_Click'));
    $today = date('Y-m-d');
    global $m;
    //準備:掃描wmzz_zan表中lastdo不是今天的,然後更新wmzz_zan_data表的remain
    $sy = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_zan` WHERE `lastdo` != '{$today}';");
    while ($sx = $m->fetch_array($sy)) {
        $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $sx['num'] . '\' WHERE `uid` = ' . $sx['uid']);
        $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan` SET `lastdo` = \'' . $today . '\' WHERE `uid` = ' . $sx['uid']);
    }
    //開始:計劃任務
    $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "wmzz_zan_data` WHERE `remain` > '0' LIMIT {$set['rem']};");
    if ($count['c'] == $set['rem']) {
        $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $set['rem'], "`remain` > '0'");
    } else {
        $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $count['c'], "`remain` > '0'");
    }
    //如果隻有一條記錄的兼容方案
    if (isset($y['tieba'])) {
        $y = array(0 => $y);
    }
    //點讚
    foreach ($y as $x) {
        if (!empty($x['pid'])) {
            $remain = $x['remain'] - $set['num'];
            $res = wmzz_zan_donow(misc::GetCookie($x['pid']), $x['tieba'], $set['num']);
            $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $remain . '\' WHERE `tieba` = \'' . $x['tieba'] . '\' AND `uid` = ' . $x['uid']);
            sleep($set['sleep']);
        }
    }
    /*
    while ($v = $m->fetch_array($x)) {
    	$u = $m->once_fetch_array("SELECT * FROM `".DB_NAME."`.`".DB_PREFIX."users` WHERE `id` = '{$v['uid']}' LIMIT 1");
    	$variable = unserialize($v['tieba']);
    	foreach ($variable as $value) {
    		wmzz_zan_get_list($u['ck_bduss'],$value['tieba'],$s['sleep'],$v['max'],$s['sp']);
    	}
    	$m->query("UPDATE `".DB_NAME."`.`".DB_PREFIX."wmzz_zan` SET  `lastdo` =  '".$today."' WHERE  `id` = ".$v['id']);
    }
    */
}
開發者ID:chajianku,項目名稱:Cloud_Click,代碼行數:43,代碼來源:run.php


注:本文中的misc::GetCookie方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。