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

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 15  |  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.   if ($_FILES["url"]["error"] > 0)
  4.     {
  5.     echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  6.     }
  7.   else
  8.     {
  9.     if (file_exists("upload/" . $_FILES["url"]["name"]))
  10.       {
  11.       echo $_FILES["url"]["name"] . " already exists. ";
  12.       }
  13.     else
  14.       {
  15.       move_uploaded_file($_FILES["url"]["tmp_name"],
  16.       "upload/" . $_FILES["url"]["name"]);
  17.           $url = $_FILES["url"]["name"];
  18.           header("Location: /shorten.php?id=$url");
  19.     }
  20. ?>