I would like for page one of my instagram site to load the photos store the photo ids etc, and when a user clicks on the like button, the like will be fired off to likes.php which will send the like to instagram. example below:
<?php
require 'instagram.class.php';
$instagram = new Instagram(array(
'apiKey' => '******************',
'apiSecret' => '******************',
'apiCallback' => 'http://****/****/index.php'
));
$token = // code that generates and properly stores token;
$instagram->setAccessToken($token);
$id = $_GET['pic'];
$instagram->likeMedia($id);
if ($result->meta->code === 200) {
echo 'Success! The image was added to your likes.';
} else {
echo 'Something went wrong :(';
}
?>
and for examples sake lets say that the page sending the like for right now looks like:
echo "<img src='like.jpg' class='like' onclick='SendID("4358734534_5435435")'>";
What should SendId look like? or what would be good to look into to get this task done, I just you to be able to click the button created above and send the id of that photo to likes.php