2012-09-19 17 views
4

我在我的網站上集成了Pin的功能,但我無法在URL或描述中傳遞多個參數。我已用下面的代碼試圖Pinterest多個參數詳細url在描述

$detail_wow_pin = $baseurl.'/wow/Wowitems/wowdetail? 
obj_id='.$obj_id.'&obj_type='.$obj_type; 

     <a href="http://pinterest.com/pin/create/button/? 
url=http://softprodigy.in/thinkbright/wow/Wowitems&media=<?=$wowimg?> 
&description=<?='http://'.$_SERVER['SERVER_NAME'].''.$detail_wow_pin?>" 
count-layout="none"> 
    <img src="<?php echo IMG_WOWS; ?>/img/pinterest.png" alt=""> 
    </a> 

由於

回答

6

我找到正確的URL編碼整個HREF,確認號(&)編碼爲& href屬性的內部。此外,&在url參數內編碼爲%26,並且將url參數移動到href屬性中的最後一個位置時,將正確地創建鏈接返回到包含圖像的頁面,當您從該圖釘板上單擊它時。

實施例:

<a href="//pinterest.com/pin/create/button/?media=http%3a%2f%2example.com%2fImages%2fimage.jpg&amp;description=Example+description.&amp;url=http%3A%2F%2Fexample.com%2FExample%2FExample.php%3Fparam1%3Dvalue1%26param2%3Dvalue2%26param3%3Dvalue3"><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png"></a> 
0

動態鏈接爲Pinterest的

下面的代碼會生成不同的網頁動態Pinterest的按鈕。

<a href="http://pinterest.com/pin/create/button/?url=http://www.example.com/page-one&amp;media=http://www.example.com/image/cache/data/image.jpg&amp;description=description will come here" class="pin-it-button" count-layout="none"> 
<img src="http://assets.pinterest.com/images/PinExt.png" data-cfsrc="//assets.pinterest.com/images/PinExt.png" title="Pin It" border="0"> 
</a> 
+0

如何參數添加多個媒體形象? –