I hope i am going to be clear with my problem. I am working on a project where I need to annotate images of vials with defects. I am at the stage where i have created a folder which contains the image's paths and is created based on the batch number. So each folder will be named differently dependig on the batch number. Now once all the images are uploaded, i want to retrieve them by running some queries so i get displayed in thumbnails all the images related to that batch. Now comes the tricky part (at least for me). I want to be able to click to the thumbnail and get redirected to the test.php page where i can see the image bigger, put in onto a canvas and make some annotation, but for some reason i am not able to retrieve the images. I am really desperate, any help would me much appreciated
<?php
require('db.php');
if (isset($_POST['mostra'])) {
$batch_number = stripslashes($_REQUEST['batch_number']);
$batch_number = mysqli_real_escape_string($con, $batch_number);
$product_name = stripslashes($_REQUEST['product_name']);
$product_name = mysqli_real_escape_string($con, $product_name);
$vial_size = stripslashes($_REQUEST['vial_size']);
$vial_size = mysqli_real_escape_string($con, $vial_size);
$Sterile = $_POST['Sterile'];
$Macchina = $_POST['Macchina'];
if (!empty($batch_number)) {
$select = mysqli_query($con, "SELECT vial_image FROM info_flaconi WHERE batch_number = '$batch_number' ");
if(mysqli_num_rows($select)) {
while($row=$select->fetch_assoc()){
echo
"<a href=\"test.php?vial={$row['vial_image']}\" ><img src=\"immagini/$batch_number/" .$row['vial_image']. "\" style = 'width: 100px; height: 100px; padding:10px;'></a>";
}
}else{
echo '<p style="color: white;"> No data available </p>';
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Import Immagini</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style_3.css">
</head>
<body>
<header>
<div class="wrapper">
<div class="logo">
<img src="biotech.png" alt="">
</div>
<ul class="nav-area">
<li><a href="dashboard.php">Home</a></li>
<li><a href="table/index.html">Contatti</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
<div class = "caricamento">
<form action="" method="POST" enctype="multipart/form-data">
<label> carica immagini flaconi: </label>
<label> Inserisci numero batch: </label><input type = "text" name= "batch_number" placeholder="batch number">
<label> Inserisci prodotto: </label><input type = "text" name= "product_name" placeholder="product name">
<label> Inserisci grandezza flacone: </label><input type = "text" name= "vial_size" placeholder="vial size">
<input type="submit" name="mostra" value="Mostra flaconi">
<select name= "Sterile">
<option value="" >--Select--</option>
<option value="Sterile Area 1" >Sterile Area 1</option>
<option value="Sterile Area 2" >Sterile Area 2</option>
<option value="Sterile Area 3" >Sterile Area 3</option>
<option value="Sterile Area 4" >Sterile Area 4</option>
<option value="Sterile Area 5" >Sterile Area 5</option>
<option value="Sterile Area 6" >Sterile Area 6</option>
<option value="PDS" >PDS</option>
</select>
<select name= "Macchina">
<option value="" >--Select--</option>
<option value="Sedeneider" >Sedeneider</option>
<option value="Groheninger" >Groheninger</option>
<option value="Optrel400" >Optrel400</option>
</select>
</div>
</form>
<?php include 'scegli_immagine.php';?>
</header>
</body>
</html>
The above code is needed in order to fetch all the images in thumbnails and be able to click on them
<?php
require('db.php');
include('upload.php');
$result=$_GET['vial'];
echo "<img src = \"immagini/$batch_number/".$result."\" style = width: 20%; height: 45%; position: relative; top: -260px; right:-180px;>";
if (isset($_REQUEST['submit'])) {
$difetto = stripslashes ($_REQUEST['difetto']);
$difetto = mysqli_real_escape_string($con, $difetto);
$commenti = stripslashes($_REQUEST['commenti']);
$commenti = mysqli_real_escape_string($con, $commenti);
$query = "INSERT INTO `annota` (difetto, commenti) VALUES ('$difetto', '$commenti')";
$result = mysqli_query($con, $query);
if ($result) {
echo "<div class='form'>
<h3>Annotazione registrata correttamente</h3><br/>
<p class='link'>Clicca qui per una nuova <a href='scegli_immagine.php'>annotazione</a>.</p>
</div>";
} else {
echo "<div class='form'>
<h3>Qualcosa è andato storto.</h3><br/>
<p class='link'>Clicca qui per <a href='scegli.php'>riprovare</a> di nuovo.</p>
</div>";
}
}
?>
</header>
</body>
</html>
With this bit of code i am trying to display the image bigger but with no success