开发者

problem with url being submitted to facebook comment count

开发者 https://www.devze.com 2023-04-07 23:02 出处:网络
hit a small problem and wondering if their is a quick easy fix im missing. im wanting to use facebooks, comment count, but for some reason the url gets changed. should have &id=9 for example at th

hit a small problem and wondering if their is a quick easy fix im missing. im wanting to use facebooks, comment count, but for some reason the url gets changed. should have &id=9 for example at the end of the url but faceboo开发者_JS百科k is removing everything from the & symbol

so for example http://www.prog3kt-mayh3m.info/index.php?page=blog&id=9 becomes http://www.prog3kt-mayh3m.info/index.php?page=blog

heres the code im having issues with, the particular code is being echo'd from within php tags

echo "<iframe src='http://www.facebook.com/plugins/comments.php?href=http://www.prog3kt-mayh3m.info/index.php?page=blog&id=" . $id . "&permalink=1' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:130px; height:16px;' allowTransparency='true'></iframe>";

any help appreciated


ok, found the solution,

replace the ampersand with %26:

<iframe src='http://www.facebook.com/plugins/comments.php?href=http://www.prog3kt-mayh3m.info/index.php?page=blog%26id=9&permalink=1' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:130px; height:16px;' allowTransparency='true'></iframe>

it should work ok :)

JsFiddle result

0

精彩评论

暂无评论...
验证码 换一张
取 消