How to Display a Facebook page which is passed viz a Server to a client's Browser
I want to display a Facebook's page which goes threw a web server and is displayed on the client's screen.
I created a PHP page and used the command file_ge开发者_JAVA百科t_content() to get a Facebook's page and Echoed it on the Screen. That works partially, the login screen appears and it asks for ID and password and some time times Facebook says that the Browser is In compatible.
Whats the procedure to work around it ?
I used a Simple code like
<?php
$homepage = file_get_contents('http://www.facebook.com/profile.php?id=100000564553314');
echo $homepage;
?>
See example #4 on the file_get_contents man page. You'll have to set up a stream context, from which you can set a header that'll override PHP's internal UserAgent, and simulate a "real" browser.
精彩评论