Can anyone help me I am facing problem while uploading image.
PHP
<?php
$msg="";
$db=mysqli_connect("localhost","root","root","man");
if(isset($_POST['submit'])) {
$fileName=$_FILES['uploadfile']['name'];
$fileTmpName=$_FILES['uploadfile']['tmp_name'];
$folder='images/';
move_uploaded_file($fileTmpName,$folder.$fileName);
$sql=mysqli_query($db,"INSERT INTO manimages(image) VALUES ($fileName)");
}
?>
HTML
<!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>Uploading Images</title>
</head>
<body>
<form action="" method="POST">
<input type="file" name="uploadfile">
<input type="submit" name="submit" value="upload image">
</form>
</body>
</html>
Error is Notice: Undefined index: uploadfile in C:\wamp64\www\ftest\index.php on line 5 and Notice: Undefined index: uploadfile in C:\wamp64\www\ftest\index.php on line 6