Dzień dobry mam taką stronę w arkuszu php:
<?php
session_start();
@include 'includes/connect.php';
$sql = "SELECT product_id, product_img FROM produkty LIMIT 16";
$result = $connect->query($sql);
?>
<!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>MangaBox</title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/x-icon" href="images/icon.png">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
<header>
<a href="#" class="logo">MangaBox</a>
<nav class="navbar" id="navbar">
<a href="Main.php">Home</a>
<a href="Products.php">Products</a>
<a href="#">About</a>
<a href="#">Contact</a>
<a href="bag.php"><i class='bx bx-shopping-bag'></i></a>
<a href="login.php"><i class='bx bx-user'></i></a>
</nav>
<i class='bx bx-menu' id="nav-btn"></i>
</header>
<center>
<div class="container">
<h1>New Mangas</h1>
<div class="new-book">
<i class='bx bx-left-arrow-alt' id="back"></i>
<div class="gallery">
<div>
<?php
if($result->num_rows > 0) { ?>
<?php while ($row = $result->fetch_assoc()){?>
<a href="produkt.php?product_id=<?php echo $row['product_id'];?>"><img src="data:image/jpg;charset=utf8;base64, <?php echo base64_encode($row['product_img']);?>" alt="obraz.jpg"></a>
<?php } ?>
<?php } ?>
</div>
</div>
<i class='bx bx-right-arrow-alt' id="next"></i>
</div>
<br>
<h1>New Films</h1>
<div class="new-films">
</div>
</div>
</center>
<script src="script/script.js"></script>
</body>
</html>
@import url("https://fonts.googleapis.com/css2?family=Tilt+Neon&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Tilt Neon", cursive;
scroll-behavior: smooth;
text-decoration: none;
border: none;
outline: none;
}
html{
overflow-x: hidden;
font-size: 62.5%;
}
body {
background-image: url("backgroundImg2.jpg");
background-size: cover;
background-attachment:fixed;
}
header{
display: flex;
padding: 2rem 9%;
position: fixed;
top: 0;
left: 0;
width: 100%;
justify-content: space-between;
z-index: 100;
align-items: center;
background-color: white;
box-shadow: 0px 20px 10px rgba(0, 0, 0, 0.45);
}
header .logo{
font-size: 40px;
font-weight: bold;
color: black;
}
.navbar a, .bx-menu{
font-size: 1.7rem;
margin-left: 30px;
color: black;
}
.navbar a i, .navbar i{
font-size: 2.5rem;
}
.navbar a:hover, .navbar i:hover{
animation: color 2s infinite;
}
header .bx-menu{
font-size: 2rem;
color: black;
font-weight: bold;
line-height: 80px;
cursor: pointer;
display: none;
}
.container {
width: 75%;
margin: auto;
background-color: rgba(255, 255, 255, 0.70);
box-shadow: 2px 2px 20px;
border: 10px solid black;
border-radius: 20px;
margin-top: 120px;
padding: 40px;
height: auto;
}
.gallery{
box-shadow: inset 1px 1px 30px 9px rgba(0, 0, 0, 1);
background-color: gray;
border: 1px solid black;
padding: 3em;
display: flex;
overflow-x: scroll;
}
.gallery::-webkit-scrollbar{
display: none;
}
.gallery div{
width: 13cm;
display: grid;
grid-template-columns: auto auto auto;
grid-gap: 20px;
padding: 10px;
flex: none;
}
.gallery div img{
width: 100%;
transition: transform 0.5s ease, box-shadow 0.5s ease;
cursor: pointer;
}
.gallery div img:hover{
transform: scale(1.1);
box-shadow: 10px 10px 0px black;
}
.new-book{
display: flex;
align-items: center;
justify-content: center;
margin: auto auto;
}
.new-book i{
font-size: 4rem;
transition: color 1s ease;
cursor: pointer;
}
.new-book i:hover{
color: red;
}
.search-container{
display: flex;
font-size: 30px;
position: relative;
justify-content: center;
align-items: center;
width: 40%;
}
.search-container .searchText{
background-color: blueviolet;
width: 100%;
border-radius: 5rem;
padding: 1rem;
padding-left: 2rem;
border: none;
outline: none;
transition: all 0.5s linear;
}
.searchText:focus{
outline: none;
}
.search-container .searchBtn{
width: 5rem;
height: 5rem;
background-color: transparent;
font-size: 2.5rem;
position: absolute;
right: 0rem;
display: grid;
place-items: center;
color: white;
}
.search-container .searchBtn:hover{
animation: color 2s infinite;
cursor: pointer;
}
.searchText::placeholder{
color: white;
}
@keyframes color {
0% {
color: red;
}
25%{
color: orange;
}
50%{
color: yellow;
}
75%{
color: orange;
}
100%{
color: red;
}
}
@media (max-width: 1100px) {
header .logo{
font-size: 30px;
font-weight: bold;
color: black;
}
header .bx-menu{
display: block;
font-size: 40px;
}
.navbar{
position: fixed;
width: 100%;
height: 100%;
left: -100%;
top: 13.5%;
text-align: center;
background-color: rgb(97, 96, 96);
transition: all .5s;
}
.active{
position: fixed;
left: 0%;
top: 13.5%;
}
.navbar a{
margin-top: 20px;
display: block;
font-size: 30px;
}
.navbar a i{
font-size: 50px;
}
.container{
margin-top: 150px;
}
}
jest to strona główna razem z stylami a mój problem jest następujący. W divie galeria wyświetlam z bazy danych obrazy i po kliknięciu przenosi mnie pod adres produkt.php?product_id=1 (przykład) jak mogę pobrać to "produkt_id=1" aby wyświetlić dane tego produktu na drugim formularzu php. Oto strona na której chcę wyświetlić dane o tym id:
<?php
session_start();
@include 'includes/connect.php';
$sqlImg = "SELECT product_id, product_img FROM produkty";
$result = $connect->query($sqlImg);
?>
<!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>MangaBox</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/produkt.css">
<link rel="icon" type="image/x-icon" href="images/icon.png">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
<header>
<a href="#" class="logo">MangaBox</a>
<nav class="navbar" id="navbar">
<a href="Main.php">Home</a>
<a href="Products.php">Products</a>
<a href="#">About</a>
<a href="#">Contact</a>
<a href="bag.php"><i class='bx bx-shopping-bag'></i></a>
<a href="login.php"><i class='bx bx-user'></i></a>
</nav>
<i class='bx bx-menu' id="nav-btn"></i>
</header>
<div class="container-product">
<div class="product-view">
<div class="img">
<?php
if($result->num_rows > 0) { ?>
<?php while ($row = $result->fetch_assoc()){?>
<img src="data:image/jpg;charset=utf8;base64,<?php echo base64_encode($row['product_img']);?>" alt="">
<?php } ?>
<?php } ?>
</div>
<div class="product_descript">
<p class="tytul"><?php ?></p>
<p class="opis"></p>
</div>
</div>
</div>
<script src="script/script.js"></script>
</body>
</html>
z góry dziękuję za odpowiedź