Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. $url = 'https://graph.facebook.com/me/feed';
  3. $messagetosend = 'ąężźćęóń';
  4. $access_token = 'CAACEdEose0cBAEuffIOb7F6YSQFOqEPiE0xXyzR6tBKstFtuj8d0fOxqarGkzFBZCYUdHhsadfseNbqP5oBZCv1vQCQ0bU4LZZAERWAGXAFfuakvg4u4xwSfd7OcoJfib2GopT9CfGLasWvRD1W7KRLz027uhQcYhGwguV8VsPMPETQKpQtxuCGZARplf1ifOfgNLZAzftBBn6FORfQvgILWZBr9C4MT1A3';
  5. $source = 'apricot626.usermd.net/img/iph-6pfree.png';
  6. $data = array('message' => $messagetosend, 'access_token' => $access_token, 'source' => $source);
  7.  
  8. // use key 'http' even if you send the request to https://...
  9. $options = array(
  10. 'http' => array(
  11. 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  12. 'method' => 'POST',
  13. 'content' => http_build_query($data),
  14. ),
  15. );
  16. $context = stream_context_create($options);
  17. $result = file_get_contents($url, false, $context);
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement