我想把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>
答案 0 :(得分:0)
我无法理解你的问题是什么。
尝试以下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>
输出: