• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getToken函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getToken函数的典型用法代码示例。如果您正苦于以下问题:PHP getToken函数的具体用法?PHP getToken怎么用?PHP getToken使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getToken函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: GamePage

function GamePage()
{
    global $base_uri;
    $uid = params('user');
    if (!isset($_SESSION['uid'])) {
        return 0;
    } else {
        createToken($_SESSION['uid']);
    }
    $reg = 0;
    $shit = 0;
    if (!isset($uid) || $uid == "") {
        $uid = $_SESSION['uid'];
    } else {
        if (!check_registration($uid)) {
            $reg = 1;
        }
        $shit = 1;
    }
    $user = getUserInfo($_SESSION['access_token'], $uid, 'photo_max');
    if ($reg) {
        register($uid, $user['first_name'], $user['last_name']);
    }
    echo $user['first_name'] . " " . $user['last_name'];
    echo "<img src=\"" . $user['photo_max'] . "\" /><br><br>";
    if ($shit) {
        echo "<a href=\"/shit/" . $_SESSION['uid'] . "/" . $uid . "/" . getToken($_SESSION['uid']) . "\">shit</a><br>";
    }
    $friends = getUserFriends($_SESSION['access_token'], $uid);
    foreach ($friends as $friend) {
        echo $friend["first_name"] . " " . $friend["last_name"] . "<br>";
        echo "<a href=\"{$base_uri}/game/" . $friend['uid'] . "\"><img src=\"" . $friend["photo_50"] . "\" /></a><hr>";
    }
}
开发者ID:Vladimir-Gerasimov,项目名称:Lavatorium,代码行数:34,代码来源:index.php


示例2: testAddTorrentRequest

 public function testAddTorrentRequest()
 {
     $request = new AddTorrentRequest(new Token(getToken()), 'C:/fakepath');
     $this->assertEquals(RequestType::PUT, $request->getRequestType());
     $this->assertEquals('torrents/addTorrent', $request->getUri());
     $this->assertEquals('C:/fakepath', $request->getFilePath());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:7,代码来源:AddTorrentRequestTest.php


示例3: getProducts

function getProducts($conn)
{
    $token = getToken();
    $sql = 'SELECT p.name, p.price, p.image, p.description, p.address, op.id FROM users u LEFT JOIN orders o ON u.id = o.users_id AND o.status = "new" LEFT JOIN orders_products op ON o.id = op.orders_id LEFT JOIN products p ON op.products_id = p.id WHERE u.token = ?';
    $stmt = $conn->prepare($sql);
    if ($stmt->execute(array($token))) {
        while ($row = $stmt->fetch()) {
            if ($counter == 3) {
                $counter = 0;
                $products .= '<tr>';
            }
            $products .= '
            <td><img src="' . $row['image'] . '" height="300px" width="300px">
                <p>' . $row['name'] . '</p>
                <p>' . $row['description'] . '</p>
                <p>' . $row['address'] . '</p>
                <p>$' . $row['price'] . '</p>
                <form method="post" action="shoppingCart.php">
                <input type="hidden" name="id" value="' . $row['id'] . '"/>
                <input type="submit" name="delete" value="DELETE"/>
                </form></td>
        ';
            $counter++;
            if ($counter == 3) {
                $products .= '</tr>';
            }
        }
        echo $products;
    }
}
开发者ID:Tucker-Cole-wm,项目名称:Shopping-Cart-Project,代码行数:30,代码来源:shoppingCart.php


示例4: createAndSend

/**
 * Creates an embedded signing experience.
 */
function createAndSend()
{
    global $_oneSigner;
    $status = "";
    // Construct basic envelope
    $env = new Envelope();
    $env->Subject = "DocuSign API SDK Sample";
    $env->EmailBlurb = "This envelope demonstrates embedded signing";
    $env->AccountId = $_SESSION["AccountID"];
    $env->Recipients = constructRecipients($_oneSigner);
    $doc = new Document();
    $doc->PDFBytes = file_get_contents("resources/Docusign_Demo_11.pdf");
    $doc->Name = "Demo Document";
    $doc->ID = "1";
    $doc->FileExtension = "pdf";
    $env->Documents = array($doc);
    $env->Tabs = addTabs(count($env->Recipients));
    $api = getAPI();
    try {
        $csParams = new CreateAndSendEnvelope();
        $csParams->Envelope = $env;
        $status = $api->CreateAndSendEnvelope($csParams)->CreateAndSendEnvelopeResult;
        addEnvelopeID($status->EnvelopeID);
        getToken($status, 1);
    } catch (SoapFault $e) {
        $_SESSION["errorMessage"] = $e;
        header("Location: error.php");
    }
}
开发者ID:virsoni,项目名称:DocuSign-SOAP-SDK,代码行数:32,代码来源:embeddocusign.php


示例5: testContainerLinkRequest

 function testContainerLinkRequest()
 {
     $request = new ContainerLinkRequest(new Token(getToken()), 'https://hoster.com/ABCDEFG');
     $this->assertEquals(RequestType::POST, $request->getRequestType());
     $this->assertEquals('unrestrict/containerLink', $request->getUri());
     $this->assertEquals('https://hoster.com/ABCDEFG', $request->getBody()->get('link'));
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:7,代码来源:ContainerLinkRequestTest.php


示例6: saveCache

function saveCache($appid, $appsecrect)
{
    $gettime = time();
    $GLOBALS["atoken"] = getToken($appid, $appsecrect);
    $GLOBALS["aticket"] = getTicket($GLOBALS["atoken"]);
    if ($GLOBALS["aticket"] == -1) {
        $GLOBALS["atoken"] = getToken($appid, $appsecrect);
        $GLOBALS["aticket"] = getTicket($GLOBALS["atoken"]);
    }
    if ($GLOBALS["aticket"] == -1) {
        $GLOBALS["atoken"] = getToken($appid, $appsecrect);
        $GLOBALS["aticket"] = getTicket($GLOBALS["atoken"]);
    }
    $arr = array("token" => $GLOBALS["atoken"], "ticket" => $GLOBALS["aticket"], "time" => $gettime);
    $ss = serialize($arr);
    $fp = fopen($GLOBALS["file"], "w");
    fputs($fp, $ss);
    fclose($fp);
    $logf = file_get_contents($GLOBALS["file"] . "log");
    $logf .= "\n";
    $logf .= json_encode($arr);
    $fp = fopen($GLOBALS["file"] . "log", "w");
    fputs($fp, $logf);
    fclose($fp);
}
开发者ID:power-pieces,项目名称:xiu_pin_pile_box,代码行数:25,代码来源:share.php


示例7: getProducts

function getProducts($conn)
{
    $token = getToken();
    $sql = 'SELECT p.name, p.price, p.preview, op.id FROM users u LEFT JOIN orders o ON u.id = o.users_id AND o.status = "new" LEFT JOIN orders_products op ON o.id = op.orders_id LEFT JOIN products p ON op.products_id = p.id WHERE u.token = ?';
    $stmt = $conn->prepare($sql);
    if ($stmt->execute(array($token))) {
        while ($row = $stmt->fetch()) {
            if ($row['id'] != null) {
                echo '<div>
                   <div class="col-sm-4 col-lg-4 col-md-4" >
                       <div class="thumbnail" style="height:550px;" >
                           <img src="' . $row["preview"] . '">

                   Name: ' . $row['name'] . '<br>
                   Price: $' . $row['price'] . '<br>
                   <form method="post" action="cart.php">
                       <input type="hidden" name="id" value="' . $row['id'] . '"/>
                       <input type="submit" name="delete" value="DELETE"/> Delete
                   </form>
                   </div></div>
                   </div>';
            }
        }
    }
}
开发者ID:chu-christopher-wm,项目名称:Shopping-Cart-Project,代码行数:25,代码来源:index.php


示例8: testContainerFileRequest

 function testContainerFileRequest()
 {
     $request = new ContainerFileRequest(new Token(getToken()), 'C:/fakepath/container.rsdf');
     $this->assertEquals(RequestType::PUT, $request->getRequestType());
     $this->assertEquals('unrestrict/containerFile', $request->getUri());
     $this->assertEquals('C:/fakepath/container.rsdf', $request->getFilePath());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:7,代码来源:ContainerFileRequestTest.php


示例9: testOffset

 public function testOffset()
 {
     $request = new DownloadsRequest(new Token(getToken()), null, 50, 5);
     $this->assertEquals(RequestType::GET, $request->getRequestType());
     $this->assertEquals('downloads', $request->getUri());
     $this->assertEquals('downloads?limit=50&offset=5', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:7,代码来源:DownloadsRequestTest.php


示例10: testOffset

 public function testOffset()
 {
     $request = new TorrentsRequest(new Token(getToken()), false, null, 50, 5);
     $this->assertEquals(RequestType::GET, $request->getRequestType());
     $this->assertEquals('torrents', $request->getUri());
     $this->assertEquals('torrents?limit=50&offset=5', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:7,代码来源:TorrentsRequestTest.php


示例11: testDeleteRequest

 public function testDeleteRequest()
 {
     $request = new DeleteRequest(new Token(getToken()), 'TORRENT_ID');
     $this->assertEquals(RequestType::DELETE, $request->getRequestType());
     $this->assertEquals('TORRENT_ID', $request->getId());
     $this->assertEquals('torrents/delete/:id', $request->getUri());
     $this->assertEquals('torrents/delete/TORRENT_ID', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:8,代码来源:DeleteTorrentRequestTest.php


示例12: testOffset

 public function testOffset()
 {
     $request = new TopicsRequest(new Token(getToken()), 4, true, null, 50, 5);
     $this->assertEquals(RequestType::GET, $request->getRequestType());
     $this->assertEquals(4, $request->getId());
     $this->assertEquals('forum/:id', $request->getUri());
     $this->assertEquals('forum/4?meta=1&limit=50&offset=5', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:8,代码来源:TopicsRequestTest.php


示例13: testDeleteRequest

 public function testDeleteRequest()
 {
     $request = new DeleteRequest(new Token(getToken()), 1);
     $this->assertEquals(RequestType::DELETE, $request->getRequestType());
     $this->assertEquals(1, $request->getId());
     $this->assertEquals('downloads/delete/:id', $request->getUri());
     $this->assertEquals('downloads/delete/1', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:8,代码来源:DeleteRequestTest.php


示例14: createNewOrder

function createNewOrder($conn)
{
    $token = getToken();
    $sql = 'INSERT INTO orders (users_id, status) (SELECT u.id, "new" FROM users u WHERE u.token = ?)';
    $stmt = $conn->prepare($sql);
    if ($stmt->execute(array($token))) {
    }
}
开发者ID:shumway-kyle-wm,项目名称:SimpleCart,代码行数:8,代码来源:index.php


示例15: testInfoRequest

 public function testInfoRequest()
 {
     $request = new InfoRequest(new Token(getToken()), 'TORRENT_ID');
     $this->assertEquals(RequestType::GET, $request->getRequestType());
     $this->assertEquals('TORRENT_ID', $request->getId());
     $this->assertEquals('torrents/info/:id', $request->getUri());
     $this->assertEquals('torrents/info/TORRENT_ID', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:8,代码来源:InfoRequestTest.php


示例16: make_topup_request_mtn

function make_topup_request_mtn($origmsisdn, $destMsisdn, $sequenceid, $amount, $tarifftypeid, $serviceproviderid, $sdesc, $operator, $statusId, $txRefId, $seqstatus, $seqtxRefdId, $lasseq, $origBalance, $destBalance, $voucherPIN, $voucherSerial, $responseCode, $responseMessage)
{
    $length = 15;
    $transId = getToken($length);
    $log_req = "insert into top_request_main (transaction_id,origmsisdn,destmsisdn,sequence_value,amount,tarriftypeid,serviceproviderid,description,operator,status_id,txrefid,seqstatus,seqtxrefid,lasseq,origbalance,destbalance,VOUCHERPIN,VOUCHERSERIAL,responsecode,responsemessage) values ('{$transId}','{$origmsisdn}','{$destMsisdn}',{$sequenceid},{$amount},{$tarifftypeid},{$serviceproviderid},'{$sdesc}','{$operator}','{$statusId}','{$txRefId}','{$seqstatus}','{$seqtxRefdId}','{$lasseq}','{$origBalance}','{$destBalance}','{$voucherPIN}','{$voucherSerial}','{$responseCode}','{$responseMessage}')";
    $sql = db_execute($log_req);
    return $sql;
}
开发者ID:hiroyalty,项目名称:skyeapi,代码行数:8,代码来源:f.php


示例17: decode

function decode($hex)
{
    $hexarr = str_split($hex, 2);
    foreach ($hexarr as $k => $v) {
        $str .= "  " . getToken(hexdec($v));
    }
    return $str;
}
开发者ID:rsiva6,项目名称:WhatsAPI,代码行数:8,代码来源:decode.php


示例18: testWithPasswordAndRemote

 function testWithPasswordAndRemote()
 {
     $request = new LinkRequest(new Token(getToken()), 'https://hoster.com/ABCDEFG', 'apassword', 'remote');
     $this->assertEquals(RequestType::POST, $request->getRequestType());
     $this->assertEquals('unrestrict/link', $request->getUri());
     $this->assertEquals('https://hoster.com/ABCDEFG', $request->getBody()->get('link'));
     $this->assertEquals('apassword', $request->getBody()->get('password'));
     $this->assertEquals('remote', $request->getBody()->get('remote'));
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:9,代码来源:LinkRequestTest.php


示例19: testWithSplitAndNoHost

 public function testWithSplitAndNoHost()
 {
     $request = new AddMagnetRequest(new Token(getToken()), 'magnet:?aaaaaaa', null, 50);
     $this->assertEquals(RequestType::POST, $request->getRequestType());
     $this->assertEquals('torrents/addMagnet', $request->getUri());
     $this->assertEquals('magnet:?aaaaaaa', $request->getBody()->get('magnet'));
     $this->assertNull($request->getBody()->get('host'));
     $this->assertNull($request->getBody()->get('split'));
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:9,代码来源:AddMagnetRequestTest.php


示例20: testNotEmptyFiles

 public function testNotEmptyFiles()
 {
     $request = new SelectFilesRequest(new Token(getToken()), 'TORRENT_ID', [1, 2, 3]);
     $this->assertEquals(RequestType::POST, $request->getRequestType());
     $this->assertEquals('TORRENT_ID', $request->getId());
     $this->assertEquals('1,2,3', $request->getBody()->get('files'));
     $this->assertEquals('torrents/selectFiles/:id', $request->getUri());
     $this->assertEquals('torrents/selectFiles/TORRENT_ID', $request->getUrl());
 }
开发者ID:ValentinGot,项目名称:real-debrid,代码行数:9,代码来源:SelectFilesRequestTest.php



注:本文中的getToken函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getTokenFieldsAndNames函数代码示例发布时间:2022-05-15
下一篇:
PHP getTitulo函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap