Skip to content
  • Home
  • Blog
    • yttags
    • Youtube
  • Categories
  • Tools
  • Server-Side
    • php
    • Node.js
    • ASP.NET
    • Magento
    • Codeigniter
    • Laravel
    • Yii
  • JS
    • AngularJS
    • Ajax
    • VueJs
    • jQuery
    • ReactJS
    • JavaScript
  • Full Form
  • Guest Post
  • Advertise
  • About
  • Contact Us
Pakainfo

Pakainfo

Web Development & Good Online education

Facebook Api Get User Id Profile Information using PHP

July 3, 2018 Pakainfo Facebook, php, Programming Leave a comment
Rate this post

Facebook Api Get User Id Profile Information using PHP

In this Post We Will Explain About is Facebook Api Get User Id Profile Information using PHP With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to how to get user information from facebookExample

In this post we will show you Best way to implement facebook api get user info,facebook get user id, hear for facebook api get user id using PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Read Also:  GET Facebook friends list email mobile profile url using Facebook Graph API

facebook api get user info,facebook get user id Example

<?php

if(isset($_POST["your_fb_url"]))
{
	$s_passurl = parse_url($_POST["your_fb_url"]); //parse_url returns an array all the PHP containing components of the URL
	
	$main_host_url = str_replace('www.','',$s_passurl["host"]); //if found Like as a  www. remove it
	
	if(strcmp($main_host_url,'facebook.com')) //here simple compare host is facebook.com
	{
		die('Please enter your valid Facebook URL'); //not a facebook url
	}
	
	$facebook_username = str_replace('/','',$s_passurl["path"]); //remove any backslash from path
	
	$data_results = fb_allget_data('http://graph.facebook.com/'.$facebook_username.'?fields=id,name,picture,locale,gender,username');
	
	if(!empty($data_results->error)) //check if any error is simple returned from facebook
	{
		die($data_results->error->message); //all the display error
	}
	
	echo 'Hi '.$data_results->name.', Your Facebook ID is : '.$data_results->id; //everything looks good
	
	//display simple all data available
	echo '<pre>'; 
	print_r($data_results); 
	echo '</pre>';
}


function fb_allget_data($json_url)
{
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $json_url);
	$json_data =  curl_exec($ch);
	return json_decode($json_data);
	curl_close($ch);
}

?>
<html>
<head>
<title>Created By Pakainfo.com : Get Faceboook ID</title>
</head>
<body>
<h1></h1>
<hr/>
<form method="post" action="">
<input name="your_fb_url" type="text" size="80" placeholder="Please Enter Your Facebook Profile Url without Login" />
<input type="submit" value="Submit" />
<hr/>
</form>
</body>
</html>

Free Live Chat for Any Issue

Get The user ID in the Facebook PHP sdk

//all libs included class
require 'php-sdk/src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => 'put_YOUR_APP_ID',
  'secret' => 'put_YOUR_APP_SECRET',
));

//simple here store Get User ID
$get_user_info = $facebook->getUser();
prtin_r($get_user_info);

Example

Download

I hope you have Got What is Get Facebook user profile using their photo filename And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Read Also:  VueJS Show Hide Password in Password TextBox with CheckBox

Related posts:

  1. GET Facebook friends list email mobile profile url using Facebook Graph API
  2. Facebook Graph Api GET User email address mobile birthday
  3. validation Update User Profile in Laravel 5.7
  4. User Profile Edit Script Update Script Laravel 7/6
  5. PHP Laravel Get current User Information
  6. Login with Facebook using PHP SDK with mysql download
  7. Access Tokens – Facebook Login – Facebook Open Graph API
  8. How to upload Profile Images to Users using Laravel 6?
  9. Manage Facebook Apps with facebook pages using PHP source
  10. Facebook Graph API Search Multiple Parameters Queries
Read Also:  Auto Post on Facebook Page using Facebook PHP API
facebook api get user emailfacebook api get user id from usernamefacebook api get usernamefacebook graph api examplefacebook graph api meget user details from facebook apihow to get user information from facebook in androidhow to get user information from facebook in php

Post navigation

Previous Post:jquery password strength Checker using regular expression
Next Post:PHP OOPS – MySQL connecting Insert update delete select Fetch Data

Search

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me
Cricday

Categories

3movierulz (48) Ajax (464) AngularJS (377) ASP.NET (61) Bollywood (92) Codeigniter (174) CSS (96) Earn Money (61) Education (53) Entertainment (108) fullform (77) Google Adsense (62) Highcharts (77) Hollywood (93) JavaScript (1354) Jobs (39) jQuery (1421) Laravel (1083) LifeStyle (50) movierulz4 (47) Mysql (1029) Mysqli (890) Node.js (38) php (2110) Programming (2320) Python (96) ReactJS (37) Software (102) Software (77) Stories (78) tamilrockers (88) Tamilrockers kannada (48) Tamilrockers telugu (47) Tech (101) Technology (2359) Tips and Tricks (107) Tools (111) Top10 (293) Trading (49) Trending (45) VueJs (250) Web Technology (83) webtools (129) wordpress (165) World (121)

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here

Web Development & Good Online education : Pakainfo by Pakainfo.
Top
Subscribe On YouTube : Download Source Code & New itsolutionstuck
We accept paid guest Posting on our Site : Guest Post Chat with Us On WhatsApp