<!DOCTYPE html>
<html lang="en">

<head>

     <?php 
          $con = mysqli_connect("localhost", "root", "root", "A3");

          $page = $_GET['id'] ?? 1;

          $sql = "select * from pages where id = $page";

          $result = mysqli_query($con, $sql);

          $content = $result -> fetch_assoc(); 
     ?>
     
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title><?php echo $content['title'];?></title>

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Gabriela&family=Quicksand&display=swap" rel="stylesheet">

     <link rel="stylesheet" href="ua-reset.css">
     <link rel="stylesheet" href="style.css">
</head>
<body>
     <?php include 'includes/header.php'; ?>

     <?php include 'includes/hero.php'; ?>

     <?php echo $content['content'];?>

     <?php include 'includes/footer.php'; ?>
</body>

<?php 
     mysqli_free_result($result);

     mysqli_close($con);
?>

</html>