PHP uploading an image by posting a form
<p>i am trying to upload image through following code.
although my if condition is executing as shown below but image is not moving to the specified path given by me. my code is below.
here is my html code </p>

<pre><code>&lt;form enctype="multipart/form-data" action="catcher.php" method="POST"&gt;
Send this file: &lt;input name="userfile" type="file" /&gt;
    &lt;input type="submit" value="Send File" /&gt;
&lt;/form&gt;
</code></pre>

<p>and here is my php code</p>

<pre><code>&lt;?php
$uploaddir = '/xampp/project/';
echo '&lt;pre&gt;';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir)) {
    echo "File is valid, and was successfully uploaded.\n";
} else {
    echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "&lt;/pre&gt;";

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

<p>can any body point out whats wrong with my code i mean why the image i am trying to upload is not moving to the specified path,,</p>
