facebook com missing from login page URL

0 votes

I am not able to login using FB in any of the applications. usually the URL should be

https://www.facebook.com/login.php?skip_api_login=1&api_key=XXX....

But in my case :

https://www./login.php?skip_api_login=1&api_key=XXX.. (without "facebook.com")

Here's the code :

<?php

require 'facebook.php';


$facebook = new Facebook(array(
  'appId'  => '137737616434442',
  'secret' => 'XXX',
  'baseurl' => 'http://localhost/facebookconnect/login/example.php',
));


$user = $facebook->getUser();

if ($user) {
  try {

    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}


if ($user) {

  $logoutUrl = $facebook->getLogoutUrl(array( 'next' => 'http://localhost/facebookconnect/login/example.php' ));
  session_destroy();  
} else {
  $loginUrl = $facebook->getLoginUrl(array(
  'scope' => 'email,user_birthday,friends_birthday,publish_stream,user_location,friends_location,user_work_history,user_likes,friends_work_history,user_about_me,friends_about_me,user_hometown',
  'redirect_uri' => 'http://localhost/facebookconnect/login/example.php'));

}


$naitik = $facebook->api('/naitik');

?>

I tried this basic Facebook code but it didn't work. Can someone help me with this issue?

 

May 28 in PHP by Kichu
• 19,040 points
8 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to get parameters from a URL string?

Hello @kartik, You can use the parse_url() and parse_str() for that. $parts = ...READ MORE

answered Aug 14, 2020 in PHP by Niroj
• 82,700 points
211 views
0 votes
1 answer

How to check if a file exists from a url using php?

Hello, You have to use CURL function does_url_exists($url) { ...READ MORE

answered Nov 3, 2020 in PHP by Niroj
• 82,700 points
2,037 views
0 votes
1 answer

How to save image from url with curl PHP?

Hello @kartik, try this: function grab_image($url,$saveto){ ...READ MORE

answered Nov 14, 2020 in PHP by Niroj
• 82,700 points
2,772 views
0 votes
1 answer

How to pass multiple variables to another page in url?

Hello @kartik, Use the ampersand & to glue variables together: $url ...READ MORE

answered Nov 23, 2020 in PHP by Niroj
• 82,700 points
6,725 views
0 votes
1 answer

CodeIgniter removing index.php from url

To solve your doubt, use the following ...READ MORE

answered Feb 23 in PHP by Aditya
• 7,280 points
54 views
0 votes
0 answers

Login using PHP and JavaScript from SQL database

I have developed a drop-down login panel using ...READ MORE

Jun 11 in PHP by narikkadan
• 10,840 points
16 views
+1 vote
1 answer

Streaming facebook data using Flume framework!!!

Hi You can find the facebook 'API' from ...READ MORE

answered Jan 21, 2020 in Big Data Hadoop by anonymous
979 views
0 votes
0 answers

Yoast SEO/Facebook OG: Image not displaying after fb url change

i recently changed the name of my ...READ MORE

Feb 14 in Others by Kichu
• 19,040 points
55 views
0 votes
1 answer

Symfony2 / Sonata SEO Bundle / og:image

cdn: server: ...READ MORE

answered Feb 17 in Others by narikkadan
• 10,840 points
17 views
0 votes
1 answer

Facebook Graph API split test for audience

for split testing Facebook /meta developers has ...READ MORE

answered Feb 18 in Others by narikkadan
• 10,840 points
24 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP