Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 4th, 2011  |  syntax: None  |  size: 0.55 KB  |  views: 45  |  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.  
  2.  
  3. <?php
  4. #user uploads file and it moves to server
  5. move_uploaded_file ($_FILES['Image']['tmp_name'], "/sites/".$_FILES['Image']['name']) or die ('Could not upload');
  6.  
  7. #testing
  8. echo "/sites/".$_FILES['Image']['tmp_name']
  9.  
  10. ?>
  11.  
  12.  
  13. <?php
  14. #create image path
  15. $img = imagecreatefromjpeg("/sites/".$_FILES['Image']['tmp_name']);
  16. ?>
  17.  
  18. <?php
  19. if($img && imagefilter($img, IMG_FILTER_PIXELATE, 3))
  20. {
  21. echo $img;
  22. }
  23. else
  24. {
  25.  
  26. echo 'Conversion failed';
  27. imagedestroy($img);
  28.  
  29. }
  30.  
  31. ?>
  32.  
  33. <img src="http://localhost/<?php echo $_FILES['Image']['name'] ?>" />
clone this paste RAW Paste Data