0

How can I check if facebook account exists by typing email?
For example, if i go to http://mysite.pl/fb/?email=email@gmail.com and if account with this email exists on facebook, it returns "true", if not, returns "false". Code I tried:

if(isset($_GET["email"])) {
    $url = file_get_contents('https://www.facebook.com/search/results/?q='.$_GET["email"]);
    echo '<pre>'.$url.'</pre>';

}

It's not working, returns info that my browser is not supported by facebook.

Zombo
  • 1
  • 62
  • 391
  • 407
cal1fornia
  • 87
  • 7

1 Answers1

1

This is not something Facebook is going to enjoy you doing. If you want to try anyway, you need to set your request header to something that they'll think is a normal web browser. This will mean using cURL instead of just file_get_contents().

See this question for more information: PHP cURL custom headers

Jeff
  • 789
  • 4
  • 13