topical media & game development

talk show tell print

mashup-flickr-13-Complete-gallery-doReplace.php / php



  <?php 
  include (dirname(__FILE__) . '/../lib/gallery.php');
  gallery = new FlickrGallery();        
  gallery->authenticate("write");
  if (!gallery->checkAuthenticatedUser())
  {
    gallery->error("You do not have permission to replace photos for this account");
  }
  
  id = _REQUEST['id'];
  if (!empty(id))
  {
    size = _FILES['file']['size'];
    filename = _FILES['file']['tmp_name'];
  
    if (!empty(filename) && is_uploaded_file(filename) && size > 0)
    {
      id = gallery->replacePhoto(filename, id);
    }
  }
  
  header('Location: http://' . _SERVER['HTTP_HOST'] . dirname(_SERVER['PHP_SELF']) 
    . '/index.php');
   ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.