php
  • html
  • facebook
  • 2011-09-19 65 views 0 likes 
    0

    我正在更新我的網站,我的飼料更新
    facebook狀態,然後飼料的鏈接。回覆在狀態0127的HTML標籤

    我使用

    echo $_POST['msg']." @"."<a href='http://xxx.ch/comment.php?id=".$result."'>link</a>"; 
    

    但在Facebook的狀態更新就是這樣,

    msg @<a href='http://xxx.ch/comment.php?id=2>link</a> 
    

    我只想

    msg @ link 
    

    回答

    1

    Facebook不支持郵件中的html標籤。只需指定url,它將顯示爲url。

    0

    鏈接應該貼在link參數,您也可以選擇該名稱的自定義名稱。請勿爲此使用message

    +0

    抱歉,但我不知道如何使用鏈接參數在Facebook中發佈。你能舉個例子嗎? –

    +0

    @Kartik:我假設你在POST中使用「message」參數。追加&鏈接= yourlinkhere就是這樣。閱讀[doc](http://developers.facebook.com/docs/reference/api/post/) – genesis

    0

    我得到它使用TinyURL的:

    function get_tiny_url($url) { 
    $ch = curl_init(); 
        $timeout = 5; 
        curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url); 
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); 
        $data = curl_exec($ch); 
        curl_close($ch); 
        return $data; 
    } 
    $new_url = get_tiny_url('http://xxx.ch/comment.php?id='.$result); 
        echo $_POST['msg']." @ ".$new_url; 
    
    相關問題