I'm trying to set up my Instagram API site so that users can select photos
I am able to save the data in an database and Display the photos but not able to make photos selectable in an different array
Here's my code:
<?php
session_start();
require 'db.php';
require 'instagram.class.php';
require 'instagram.config.php';
if (!empty($_SESSION['userdetails']))
{
$data=$_SESSION['userdetails'];
// Store user access token
$instagram->setAccessToken($data);
}
else
{
header('Location: index.php');
}
?>
<?php
$popular = $instagram->getUserMedia($data->user->id);
// Display results
foreach ($popular->data as $data)
{
echo "<img src=\"{$data->images->thumbnail->url}\";">
}
?>