Gelen width ve height verilerini Ajax çekmelisiniz,

test.php
<html lang="tr">
<head>
    <meta charset="UTF-8">
    
    <title>Test</title>
    
</head>

<body>
    
    <p class="ekran_coz"> Ekran Cözünürlük <span style="font-weight: 700;">  </span> </p>
    
    <button id="veriCek" >Veriyi database'e çek</button>
    
    
    <p class="veriGeldiMi"></p>

    
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js">     </script>

    
<script>

$(function(){
    
var w=$(window).width(),h=$(window).height();


$(".ekran_coz span").text(w+"x"+h);
    
/* Ajax ile w ve h değerlerini almanız gerekiyor */

    $("#veriCek").click(function(){
            $.ajax({
                url:'config.php',
                type:'POST',
                data: { width: w, height: h},
                success: function(res){
                    $('.veriGeldiMi').text(res);
                }
            });
});
}
);
    
</script>
</body>
</html>
config.php
<?php
$width = $_POST['width'];
$height = $_POST['height'];
echo $width . 'x'. $height ;
// burada gelen $width ve $height değerlerini database'e aktarabilirsiniz
?>
Buraya dosyalari aktardim inceleyebilirsiniz: https://dosya.co/pvvbvcja9mzo/r10.rar.html