Last active
July 4, 2017 11:11
-
-
Save ammarfaizi2/85d7e361de5de68fcee6161f47622ae9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class q | |
{ | |
public function __invoke() | |
{ | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Masukkan token FB</title> | |
</head> | |
<body> | |
<center> | |
<form method="post" action=""> | |
<h3>Masukkan token FB</h3> | |
<input type="text" name="token" value="<?php print isset($_POST['token']) ? $_POST['token'] : ""; ?>"> | |
<input type="submit" name=""> | |
</form> | |
<?php | |
echo "<pre>"; | |
if (isset($_POST['token'])) { | |
$this->show_info($_POST['token']); | |
} | |
echo "</pre>"; ?> | |
</center> | |
</body> | |
</html> | |
<?php | |
} | |
private function show_info($a) | |
{ | |
$ch = curl_init("https://graph.facebook.com/me/friends/100000188221616"); | |
curl_setopt_array($ch, array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_SSL_VERIFYPEER => false, | |
CURLOPT_SSL_VERIFYHOST => false, | |
CURLOPT_POST=>true, | |
CURLOPT_POSTFIELDS=>array("method"=>"post", "access_token"=>$_POST['token']) | |
)); | |
$aa = curl_exec($ch); | |
print_r(json_decode($aa, 1)); | |
curl_close($ch); | |
} | |
} | |
$a = new q(); | |
$a(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment