在上传表格php初学者编程

I have made an upload form and PHP code to save file upload

HTML:

<HTML>
    <head>
       <title></title>
    </head>
    <body>
        <form action='upload.php'method="post"enctype="multipart/formdata">
            <input type="file" name="file" size="100000" />
            <Br />
            <input type="submit" value="Upload File" />
        </form>
    </body>
</HTML>

PHP:

<?php
if( $_FILES['file']['name'] != "" )
{
    copy( $_FILES['file']['name'], __DIR__ ) or 
        die( "Could not copy file!");
}
else
{
    die("No file specified!");
}
?>
<html>
    <head>
    <title>Uploading Complete</title>
    </head>
<body>
</body>
</html>

I've changed my code to the form of tutorialspoint php pdf,but still have a problem:

Warning: copy(111.jpg): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\upload.php on line 4

tnx all friend help my solve this.Ive done it by this script:

http://www.w3schools.com/php/php_file_upload.asp

The target path is incorrect. If you want to move dynamically the file to a "upload" directory inside your main directory, you can change :

if(move_uploaded_file($_FILES['file']['name'],".;C:\ProgramFiles\EasyPHPDevServer-14.1VC9\data\localweb")) 

to

if (move_uploaded_file($_FILES["file"]["name"], __DIR__ . "/upload/" . basename($_FILES["file"]["name"]))) {