SHARE
TWEET

Untitled

a guest Aug 4th, 2011 48 Never
  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'] ?>" />
RAW Paste Data
Top