Php picture upload Fail
<p>So I am trying to create a website that will allow a user to put in a username and then be able to upload a file. currently every thing is local and run through Apache. The site is quit dull but i get an error on my php function. Any suggestions, thanks.</p>

<pre><code>    &lt;?php

    $ path = "files/";

    $path = $path . basename( $_FILES['userfile']['name']);

    if(move_uploaded_file($_FILES['userfile']['tmp_name'], $path)) {

    echo "Success uploading". basename($_FILES['userfile']['name']);

     } else{

    echo "Error when uploading file.";

    }

    ?&gt;
</code></pre>

<p>==================================================================================</p>

<h1>HTML CODE:</h1>

<pre><code>    &lt;html&gt;
    &lt;head&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;form enctype="multipart/form-data" action="uploadfile.php" method="POST"&gt;
    Choose File: &lt;input name="userfile" type="file" /&gt;&lt;br /&gt;
    &lt;input type="submit" value="Upload File" /&gt;
    &lt;/form&gt;
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
