cal1fornia
cal1fornia

Reputation: 87

Check if account exists by email (facebook)

How can I check if facebook account exists by typing email?
For example, if i go to http://mysite.pl/fb/[email protected] 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.

Upvotes: 0

Views: 1556

Answers (1)

Jeff
Jeff

Reputation: 799

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

Upvotes: 1

Related Questions