Exemplo n.º 1
0
<?php

require_once "FlickrClient.php";
session_start();
ob_start();
$api_key = $_SESSION["key"];
$shared = $_SESSION["shared"];
$frob = $_SESSION["frob"];
$photo_id = $_GET["id"];
$url = $_GET["url"];
$title = $_GET["title"];
ob_end_flush();
$flicker_client = new FlickrClient($api_key);
$res_token = $flicker_client->FlickrAuthGetToken($frob);
$special = array('&lt;', '&quot;', '&gt;');
$replace = array('<', '"', '>');
$string = str_replace($special, $replace, $res_token);
$xml2 = <<<XML
<?xml version="1.0"?>
{$string}
XML;
$XML2 = new SimpleXMLElement($xml2);
$token = (string) $XML2->auth->token;
$_SESSION["token"] = $token;
file_put_contents("/tmp/toc1.txt", $token);
ob_end_flush();
?>

<html>
<head>
<title>Flickr recent photos</title>