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, 2022 in PHP by Kichu
• 19,050 points
293 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,880 points
630 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,880 points
3,584 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,880 points
6,681 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,880 points
20,980 views
0 votes
1 answer

CodeIgniter removing index.php from url

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

answered Feb 23, 2022 in PHP by Aditya
• 7,680 points
929 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, 2022 in PHP by narikkadan
• 63,420 points
3,423 views
0 votes
0 answers

FB Login not working with React Native iOS v13+

I've a project with following configuration. "react": "16.8.3", "react-native": ...READ MORE

Nov 10, 2022 in Mobile Development by gaurav
• 23,260 points
1,072 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
1,985 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, 2022 in Others by Kichu
• 19,050 points
609 views
0 votes
1 answer

Symfony2 / Sonata SEO Bundle / og:image

cdn: server: ...READ MORE

answered Feb 17, 2022 in Others by narikkadan
• 63,420 points
332 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP