2010-11-12 22 views
0

我使用實像按鈕移到實像按鈕

<iframe src="http://www.facebook.com/widgets/like.php?href={url}&amp;layout=button_count&amp;" 
     scrolling="no" frameborder="0" style="border:none; width:150px; height:25px">/iframe> 

=> {URL}是動態值

也我使用

$facebook->api_client->fql_query('SELECT user_id FROM like WHERE post_id="{url}"'); 

抓取誰喜歡商品的用戶但我沒有得到任何輸出。

Plz help。

回答

3

您不需要用{$url}代替嗎?

也使用urlencode()來編碼$url也更好。

+0

感謝您的回覆,是的,我使用$ url eventhough它不工作。例如$ url =「http:// qqqqq/pdtdetail/1」 – Anish 2010-11-12 06:49:09

+0

你需要使用完整的URL,我相信....'http://www.mysite.com/...' – 2010-11-12 06:53:43

+0

謝謝,是的ia使用完整的網址,它不工作。 – Anish 2010-11-12 06:58:26

0

針對對方的回答通過動靜能量,

我不認爲應該用urlencode編碼,因爲它是一個字符串。

相反,檢查是否啓用magicquotes

如果啓用magicquotes,你沒有篩選輸入(可以用命令get_magic_quotes_gpc()檢查狀態),它已經被過濾。如果未啓用,則使用addslashes而不是urlencode。我相信代碼將是:

$facebook->api_client->fql_query('SELECT user_id FROM like WHERE post_id="{'.addslashes(url).'}"');