I want to get the uploaded file path , I have created a folder in htdocs called project inside the folder there is another folder called images which holds image files and a php file called test.php which contains this code:
<?php
if(isset($_POST['submit']))
{
    $handle =$_FILES["filename"]["tmp_name"];
    echo $handle;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
 <form action="" method="POST">
    <input type="file" name="filename">
    <input type="submit" value="Upload" name="submit">
    </form>
</body>
</html>
What I want is when I upload an image from the folder images I want to get the path images/photo.jpg but this code isnt working it says undefined index filename how can I fix it and get what I want ?
 
    