简体   繁体   English

Facebook喜欢按钮

[英]facebook like button

i am using facebook like buttton 我正在使用像buttton这样的facebook

<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} is dynamic value => {url}是动态值

also i am using 我也在用吗

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

to fetch the users who likes the product but i am not getting any output. 获取喜欢该产品的用户,但我没有任何输出。

Plz help. 请帮助。

Won't you have to use {$url} instead? 您不是必须使用{$url}吗?

It is also better to encode the $url using urlencode() as well. 也最好使用urlencode()$url进行urlencode()

In response to the other answer by 動靜能量, 针对动静能量的其他回答,

I don't think that should be encoded with urlencode since it is in a string. 我不认为应该使用urlencode对其进行编码,因为它在字符串中。

Instead, check if you have magicquotes enabled (you can check the status with the command get_magic_quotes_gpc() ) 相反,请检查是否已启用魔术引号(可以使用命令get_magic_quotes_gpc()检查状态)。

If you have magicquotes enabled, you don't have to screen the input, it is already filtered. 如果启用了魔引号,则不必筛选输入,它已经被过滤。 If it is not enabled, instead of urlencode, use addslashes. 如果未启用,请使用addlashes代替urlencode。 I believe the code would be: 我相信代码将是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM