<?php /**/ ?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
    <title>pearsoap_flickr2.php</title>
  </head>
  <body>
  <?php
  ini_set(
    'include_path',
      ini_get( 'include_path' ) . PATH_SEPARATOR . "/home/rdhyee/pear/lib/php" . PATH_SEPARATOR . '/usr/local/lib/php'
      );
  require 'SOAP/Client.php';

  $soap = new SOAP_Client('http://api.flickr.com/services/soap/');
  $tags = "flower";

  $params = array(
              new SOAP_Value('method','string', 'flickr.photos.search'),
              new SOAP_Value('api_key','string', 'e81ef8102a5160154ef4662adcc9046b'),
              new SOAP_Value('tags','string', $tags),
              new SOAP_Value('per_page','string', '5')
            );

  $results = $soap->call('FlickrRequest', $params, 'urn:flickr');
  $xml = simplexml_load_string($results);
  echo "total number of pictures:", $xml['total'];
  ?>
  </body>
</html>

