<?php

$photo_dir = "photos/";

function getPhotosFromID($id=null)
{
   global $photo_dir;

   if ($id == null)
   {
      print "Nie podano identyfikatora";
      return false;
   }

   $xml = "<photos id=\"" . $id . "\">";

   $dir = opendir($photo_dir . $id);
   while (false !== ($file = readdir($dir))) 
   {
      if ($file != "." && $file != ".." && $file != ".DS_Store") 
      {
         $xml .= "	<photo name=\"" . "" . "\" src=\"" . $file . "\" />\n";
      }
   }
   closedir($dir);	

   $xml .= "</photos>";

   return $xml;
}

?>
