Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: None  |  size: 0.70 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Delete Image Files From Server
  2. $path = 'UploadedFiles/' . $username . '/' . $locationid . '/';
  3.  
  4. unlink( $path . $imagename );
  5. unlink( $path . 'Thumbnails/' . $imagename );
  6.        
  7. $username = str_replace( array( '..', '/', '\', ':' ), '', $username );
  8. $imagename = str_replace( array( '..', '/', '\', ':' ), '', $imagename );
  9. $locationid= str_replace( array( '..', '/', '\', ':' ), '', $locationid );
  10.        
  11. <form name="deleteImageX" method="GET" target="your.server.org/deleteImage.php">
  12.         <input type="hidden" name="userName" value="theUserNameAssociatedWithThePicture" />
  13.         <input type="hidden" name="locationId" value="locationOfThePicture" />
  14.         <input type="submit" value="delete"/>
  15.     </form>