Jump to content

need help with adding fb status to my website


divinedesigns1

Recommended Posts

ok so i have been looking up some information about how to add facebook status to a personal website, which i found how too but im still having problems displaying those status onto the website and i keep on getting errors on top of that

Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\wamp\www\Spider 2.0\grind.php on line 34

but i also getting an error stating that theres no error

Warning: file_get_contents(https://graph.facebook.com/5/feed?access_token=6): failed to open stream: No error in C:\wamp\www\Spider 2.0\grind.php on line 34

how can i go about fixing these errors? the code

<?php//Get the contents of facebook page$FBpage = file_get_contents('https://graph.facebook.com/5/feed?access_token=6');// encode the url$FBpage = urlencode($FBpage);// Interpret the data with JSON$FBdata = json_decode($FBpage);// Loop through the data for each news itemforeach($FBdata->data as $news){// Explode News and Page ID's into 2 Values$StatusID = explode("_", $news->id);echo '<li>';// check for empty statusif(!empty($news->message)){  echo $news->message;}echo '</li>';}?>

ill accept all help and hints as usual........thanks in advice

Link to comment
Share on other sites

Your server doesn't support using https for file_get_contents, you need to enable that in php.ini if you control the server. http://www.php.net/m...allow-url-fopen
oh ok, imma go read about that now
Link to comment
Share on other sites

Your server doesn't support using https for file_get_contents, you need to enable that in php.ini if you control the server. http://www.php.net/m...allow-url-fopen
how do i enable it on a wamp server?
Link to comment
Share on other sites

The type of server doesn't matter. To change options that PHP uses, edit php.ini and restart the server.
now i have an error
[color=#000000][b]Warning[/b]: Invalid argument supplied for foreach() in [b]/home/content/14/8709614/html/goe/grind.php[/b] on line [b]41[/b][/color][color=#000000]

[/color]which im not sure how to fix since this is not my script

Link to comment
Share on other sites

That means you're not sending an array to foreach, which might be because they are trying to URL-encode the text that comes back.

which im not sure how to fix since this is not my script
Well it's not my script either, but that doesn't mean I can't look at the code and see what it's trying to do and whether it makes sense. You're running it, so you can also add debugging output to see what data it is using.
Link to comment
Share on other sites

That means you're not sending an array to foreach, which might be because they are trying to URL-encode the text that comes back. Well it's not my script either, but that doesn't mean I can't look at the code and see what it's trying to do and whether it makes sense. You're running it, so you can also add debugging output to see what data it is using.
ok, thanks jsg
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...