the backend part:
$producttitle = $_POST['product-title'];
$price = $_POST['price'];
$category = $_POST['Category'];
$file = $_FILE['file_upload'];
$description = $_POST['description'];
$adq = "INSERT INTO Advertenties (Titel, Prijs, Categorie, Image, Beschrijving) VALUES (:product-title, :price, :category, :file_upload, :description);";
$query = $GLOBALS['$odb']->prepare($adq);
$results = $query->execute(array(
":product-title" => $producttitle,
":price" => $price,
":category" => $category,
":file_upload" => $file,
":description" => $description
));
Front end:
<?php
require_once('../classes/layout_shared.php');
?>
<html lang="NL">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../css/bootstrap.css">
</head>
<body>
<div class="container">
<div class="col-md-9">
<form method="POST" action="../classes/upload.php" class="ad-form" enctype="multipart/form-data">
<lable>Titel</lable>
<input class="form-control" type="text" name="product-title"/>
<lable>Bedrag/Bieden vanaf:</lable>
<input class="form-control" type="text" name="price"/><br>
<lable>Categorie</lable>
<input class="form-control" type="" name="category"/><br>
<lable>Image</lable>
<input class="form-control" type="file" name="file_upload"/> <br>
<lable>Beschrijving:</lable>
<textarea class="form-control" placeholder="Voeg een beschrijving van het product toe" name="description"></textarea></br>
<input type="submit" name="toevoegen" value="Toevoegen"/>
</form>
</div>
</div>
</body>
</html>
So, this is my code above. It's for some reason giving me an error but I just can't undertand why. I've scoured the internet, and all I can find is something doesn't match something. I've gone through this so many times, its starting to annoy me now.
Any ideas?