This is my error:

> 
> Notice: Undefined index: file in
>  C:\xampp\htdocs\Project\Template1\users\index.php on line 21 Notice:
>  Undefined index: file in
>  C:\xampp\htdocs\Project\Template1\users\index.php on line 23 please
>  uploaded
> 
> 
> 

How to get rid of it? 

Html Code:

```
<form action="index.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" id="file"><br><br>
<input type="submit" value="submit" name="submit">
</form>

```

Php Code:

```
<?php

    $name = $_FILES['file']['name'];
    $temp_name = $_FILES['file']['temp_name'];

    if (isset($name)) {

        if (!empty($name)) {
            $location = '../uploads/';
        }

        if (move_uploaded_file($temp_name, $location.$name)) {
            echo 'uploaded';
        }

    } else {
        echo 'please uploaded';
    }
?>

```