Sure here's a fast way to go about getting the information you want:
<?PHP
define('FACEBOOK_APP_ID', 'yourappIDhere');
define('FACEBOOK_SECRET', 'yourFBsecretkeyhere');
function get_facebook_cookie($app_id, $application_secret) {
$args = array();
if(isset($_COOKIE['fbs_' . $app_id])){
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
}
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
$payload .= $key . '=' . $value;
}
}
if(isset($args['sig'])){
if (md5($payload . $application_secret) != $args['sig']) {
return null;
}
else
return $args;
}
else
return null;
}
$cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
</head>
<body>
<?php if ($cookie) { ?>
Your user ID is <?PHP echo $cookie['uid']; ?>
<?PHP
$user = json_decode(file_get_contents('https://graph.facebook.com/me/access_token=' . $cookie['access_token']))->data;
} else {
?>
<fb:login-button perms="email"></fb:login-button>
<?php } ?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: '<?= FACEBOOK_APP_ID ?>', status: true,
cookie: true, xfbml: true});
FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
</script>
</body>
</html>
After what Fair mentioned above, here's the very BASIC code you need to get the authentication setup for yourself.
HTH :)
You can change the parameters for the login button so it's not just "email" and then search by whatever else you may desire.