what's wrong with the upload code?
<pre><code>&lt;?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
  $path= "upload/".$HTTP_POST_FILES['ufile']['name'];
  if($ufile !=none)
  {
  if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
  {
  echo "Successful&lt;BR/&gt;";
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
  echo "File Name :".$HTTP_POST_FILES['ufile']['name']."&lt;BR/&gt;";
  echo "File Size :".$HTTP_POST_FILES['ufile']['size']."&lt;BR/&gt;";
  echo "File Type :".$HTTP_POST_FILES['ufile']['type']."&lt;BR/&gt;";
  echo "&lt;img src="$path" width="150" height="150"&gt;";
  }
  else
  {
  echo "Error";
  }
  }
  ?&gt;
</code></pre>

<p>it is an toturial form here <a href="http://tutorialblog.info/2010/08/06/php-upload-single-file.html" rel="nofollow">http://tutorialblog.info/2010/08/06/php-upload-single-file.html</a>
when i tried in my local environment. it displays an error? what's wrong with the code? thank you.</p>

<p>first, i think this is wrong.   <code>if($ufile !=none)</code> it should be   <code>if($_POST['ufile' !=none)</code>
am i right?</p>
