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

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 9  |  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. <?php
  2.  
  3. $target_path = "images/";
  4.  
  5. $target_path = $target_path . basename($_FILES['file']['name']);
  6.  
  7. if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
  8.         echo "The file ". basename( $_FILES['file']['name']) . " has been uploaded";
  9. } else {
  10.         echo "There was an error uploading the file, please try again!";
  11. }
  12.  
  13. ?>