topical media & game development

talk show tell print

mashup-flickr-07-Exercise-1-gallery-doEdit.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 edit these details");
  }
  
  id = _REQUEST['id'];
  title = _REQUEST['title'];
  description = _REQUEST['description'];
  tags = _REQUEST['tags'];
  
  if (!empty(id))
  {
    gallery->setMeta(id, stripslashes(title), stripslashes(description));
    gallery->setTags(id, stripslashes(tags));
  }
  
  header('Location: http://' . _SERVER['HTTP_HOST'] . dirname(_SERVER['PHP_SELF']) 
    . '/photo.php?id=' . id);
  ?>
  


(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.