0

我正在使用 Tinypass.com 作为付费墙,并希望在标签内显示来自数据库表的数据。

我想在下面替换:'ECHO DATA FORM DB TO GO HERE'

到目前为止,我有:

    <?php 
        /* Include TinyPass - make sure to use the correct path */
        include_once "lib/TinyPass.php";

        // configure Tinypass
        TinyPass::$SANDBOX = true;

        # Chanage these values with your TinyPass applicatin's settings
    TinyPass::$AID          = "76JigADEH5";
        TinyPass::$PRIVATE_KEY  = "aj43agFz9ZGxq8yPlZN4PHn01Xiy0bnezWmpEirC";

        /*
        If you want to integrate this system with logged in user then RID should be [ObjectName-UserID]
        */
        $rid = "Content-1"; #unique_resource_id
        $store = new TPAccessTokenStore();
        $store->loadTokensFromCookie($_COOKIE);
        $token = $store->getAccessToken($rid);

        # If anonymous user has rights to see content
        if($token->isAccessGranted()) {
            //Access granted! Display requested resource to the user
            echo '<div class="vendor"><iframe src="http://player.vimeo.com/video/25708134?title=0&amp;byline=0&amp;portrait=0" width="500" height="281" frameborder="0"></iframe></div>';   } else {
            echo '<div style="background-color:#D3768D; width:100%; height:281px;"></div><div style="padding:15px;" >

            ECHO DATA FORM DB TO GO HERE 

            <br> ';
            $resource = new TPResource("$rid", "Paid Content");

            //Create 3 price options
            $po1 = new TPPriceOption("5.00", "24 hours");
            $po2 = new TPPriceOption("10.00", "72 hours");
            $po3 = new TPPriceOption("20.00", "30 days");

            $offer = new TPOffer($resource, $po1);
            $offer->addPriceOption($po2);
            $offer->addPriceOption($po3);
    $ticketoptions = array();
$ticketoptions["btn.size"] = "2";
$purchaseRequest = new TPPurchaseRequest($offer, $ticketoptions);

            $buttonHTML = $purchaseRequest->generateTag();

            //output button HTML in the place where Tinypass button is supposed to be rendered
             echo  $buttonHTML;
        }   

    ?>

通常我会使用:

<?php echo $row_tutorial['text_after']; ?>

但显然这不适用于另一个标签。有任何想法吗

4

1 回答 1

0

所以你想要的是一个连接的字符串

echo '<div style="background-color:#D3768D; width:100%; height:281px;"></div><div style="padding:15px;" >' .  $row_tutorial['text_after']. '<br> ';
于 2013-06-13T14:37:40.363 回答