Php 已经在instagram中大量使用,但没有显示我的基本细节
我正在使用PHP语言。我已经获得了客户机id和客户机机密,并且在配置文件中插入了这两个值+回调URL。我的第一个页面是我的登录页面,当我点击登录页面时,它只会将我重定向到此页面。在代码中,我获取代码,如果$data为空,则ECHO 1将显示我的所有详细信息。 但当我点击登录按钮时,它只显示我1,但我已登录instagramPhp 已经在instagram中大量使用,但没有显示我的基本细节,php,instagram,Php,Instagram,我正在使用PHP语言。我已经获得了客户机id和客户机机密,并且在配置文件中插入了这两个值+回调URL。我的第一个页面是我的登录页面,当我点击登录页面时,它只会将我重定向到此页面。在代码中,我获取代码,如果$data为空,则ECHO 1将显示我的所有详细信息。 但当我点击登录按钮时,它只显示我1,但我已登录instagram <?php //require 'db.php'; require 'instagram.class.php'; require 'instagram.config.p
<?php
//require 'db.php';
require 'instagram.class.php';
require 'instagram.config.php';
// Receive OAuth code parameter
$code = $_GET['code'];
// Check whether the user has granted access
if (true === isset($code)) {
// Receive OAuth token object
$data = $instagram->getOAuthToken($code );
// Take a look at the API response
if(empty($data->user->username))
{
echo "1";
}
else
{
session_start();
$_SESSION['userdetails']=$data;
echo $user=$data->user->username;
echo $fullname=$data->user->full_name;
echo $bio=$data->user->bio;
echo $website=$data->user->website;
echo $id=$data->user->id;
echo $token=$data->access_token;
}
}
else
{
// Check whether an error occurred
if (true === isset($_GET['error']))
{
echo 'An error occurred: '.$_GET['error_description'];
}
}
?>