Show Code: process-favourite.php

<?php include 'session.php'?>
<!DOCTYPE html>
<html>

<head>
    <title>Alexandria</title>
    <link href="style1.css" rel="stylesheet" type="text/css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="refresh" content="1;URL='pieces-read.php'">
</head>

<body>


    <?php include 'nav.php'?>
    <?php include 'db-connect.php'?>
    <main>
        Favourite has been added.
        <?php
        $piece_id
=$_GET['piece_id'];
        
        if(!isset(
$_SESSION['favArr'])){
            
$favArr=array();
            
$_SESSION['favArr']=$favArr;
        }
        
        
array_push($_SESSION['favArr'],$piece_id);
        
        
        
?>



        <?php mysqli_close($con);  //Close Connection ?>


    </main>

</body>

</html>