[英]Facebook Like Button is not displaying
我想在網站上將Facebook設為我的fb頁面的按鈕。 我正在使用iframe,當我將此i框架放置在html文件中時它可以工作,但是當我將其放置在php文件中時它不顯示任何東西。 請幫助我解決它,非常感謝!
<iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.yourpoetrypoint.tk&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>
<iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FYourPoetryPoint&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>
我不明白您的問題是什么。
嘗試以下PHP代碼:
<html>
<body>
<!-- Without echo or print -->
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.yourpoetrypoint.tk&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FYourPoetryPoint&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>
<?php
//With echo
echo '<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.yourpoetrypoint.tk&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>';
echo '<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FYourPoetryPoint&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>';
//With print
print('<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.yourpoetrypoint.tk&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>');
print('<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FYourPoetryPoint&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>');
?>
</body>
</html>
輸出:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.