Ik wil een plaat je beeld brengen met php. (Dit moet uiteindelijk een boek worden, maar das hier relevant)
Nu heb ik de volgende code:
idex.php
<?php
require_once('./operations.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Upload</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<body>
<h1 class="text-center my- 3" >Registration Form</h1>
<div class = "container d-flex justify-content-center">
<form action="display.php" method= "POST" class="w-50" enctype="multipart/form-data">
<?php
echo inputFields("Username","username","","text");
echo inputFields("Mobile","mobile","","text");
echo inputFields("","file","","file");
?>
<button class="btn btn-dark" type="submit" name = "submit">Submit</button>
</form>
</div>
</body>
</html>
connect.php
<?php
$con = mysqli_connect('localhost', 'root', 'usbw', 'ImageUploadProject');
if(!$con)
{
die(mysqli_error($con));
}
?>connect.php
<?php
$con = mysqli_connect('localhost', 'root', 'usbw', 'ImageUploadProject');
if(!$con)
{
die(mysqli_error($con));
}
?>Nu krijg ik de volgende foutmelding:
Connection Succesful
Notice: Undefined index: file in C:\USB WebServer\root\Youtube9\display.php on line 8
ed
2
Displaying Data
Wat is hier het probleem?