Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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 );
- 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'];
- }
- }
- ?>
- session.save_handler = memcache
- session.save_path = "tcp://localhost:11211"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement