I have a project For school. I need to make a flower shop and a way to upload new products (flowers). So I made a page where I add a new product and it works except for the image. I just don't know how to send the photo to the database. I work with a domain from school and all the examples on the internet show how to do this to localhost. I don't know how to explain it further.
A product/flower has a name, category, price, description.
This is what my 'add product' page looks like (it does not include the add photo):
<html lang="en">
<?php include '../head.php' ?>
<?php
include '../databasecon.php';
?>
<body>
<!--================Top Header Area =================-->
<header class="shop_header_area carousel_menu_area">
<!--================Categories Product Area =================-->
<section class="categories_product_main p_80">
<div class="container" style="max-width: unset;">
<div class="col-lg-12" style="padding: 0; text-align:center;">
<h1 style="margin:0; padding-bottom: 40px; color: #09366C; font-weight: bold; text-align:left;"> Bloem toevoegen </h1>
</div>
<div class="categories_main_inner">
<div class="row row_disable">
<div class="col-lg-12">
</div>
<?php include 'menubeheer.php' ?>
<div class="float-left col-lg-9">
<?php
$conn = Opencon();
$QUERY = "SELECT * FROM producten";
if (!empty($_POST)) {
$naam = htmlspecialchars($_POST['product_naam']);
$categorie = htmlspecialchars($_POST['product_categorie']);
$prijs = htmlspecialchars($_POST['product_prijs']);
$omschrijving = htmlspecialchars($_POST['product_omschrijving']);
$insert = "INSERT INTO producten (product_naam,product_categorie,product_prijs,product_omschrijving)
VALUES('$naam','$categorie','$prijs','$omschrijving')";
}
?>
<form action="bloemtoevoegen.php" method="POST">
<div class="col-lg-2" style="float: left; margin-top: 10px;"> Product naam </div>
<div class="col-lg-10" style="float: left; margin-top: 10px;">
<input type="text" name="product_naam" style="width: 35%;" required><br>
</div>
<div class="col-lg-2" style="float:left; margin-top: 10px;"> Categorie </div>
<div class="col-lg-10" style="float: left; margin-top: 10px;">
<select name="product_categorie">
<option value="bloem">Losse bloem</option>
<option value="boeket">Boeket</option>
</select>
</div>
<div class="col-lg-2" style="float: left; margin-top: 10px;"> Prijs </div>
<div class="col-lg-10" style="float: left; margin-top: 10px;">
<input type="text" name="product_prijs" style="width: 35%;" required><br>
</div>
<div class="col-lg-2" style="float: left; margin-top: 10px;"> Omschrijving </div>
<div class="col-lg-10" style="float: left; margin-top: 10px;">
<input type="text" name="product_omschrijving" style="width: 50%; height:100%;" required><br>
</div>
<div class="col-lg-2" style="float: left; margin-top: 10px;"> Foto </div>
<div class="col-lg-10" style="float: left; margin-top: 10px;">
<input type="file" name="product_foto">
</div>
<div class="col-lg-12">
<b>Liefst een foto met afmetingen van 300 bij 200!</b>
</div>
<!-- <div class="col-lg-10" style="float: left; margin-top: 10px;">
<input type="text" name="product_fotos" style="width: 35%;" required><br>
</div> -->
<br>
<input type="submit" class="add_cart_btn" style="cursor: pointer; margin-top:30px;" value="Opslaan" name="submit">
</form>
</div>
</div>
</div>
</div>
</section>
<?php include '../script.php' ?>
</body>
</html>