Reputation: 13
i am using facebook like buttton
<iframe src="http://www.facebook.com/widgets/like.php?href={url}&layout=button_count&"
scrolling="no" frameborder="0" style="border:none; width:150px; height:25px">/iframe>
=>{url} is dynamic value
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.
Upvotes: 0
Views: 314
Reputation: 2567
In response to the other answer by 動靜能量,
I don't think that should be encoded with urlencode since it is in a string.
Instead, check if you have magicquotes enabled (you can check the status with the command 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. I believe the code would be:
$facebook->api_client->fql_query('SELECT user_id FROM like WHERE post_id="{'.addslashes(url).'}"');
Upvotes: 0
Reputation: 151006
Won't you have to use {$url}
instead?
It is also better to encode the $url
using urlencode()
as well.
Upvotes: 3