Im trying to pass a php variable from php page and use that variable in jq.
trying to assing to the image a class that is a php variable
the php code:
while($row = $results->fetch_assoc()) {
$id = bin2hex(openssl_random_pseudo_bytes(8));
$pro_makat=$row["product_makat"];
$pro_id = $row['product_id'];
$products_list .= <<<EOT
<li>
<form class="form-item">
<h3 id="title" style="color:#cc00cc;">{$row["product_title"]}</h3>
<div><a href=""><img id="image" src="admin_area/product_images/{$row['product_image']}" class="$id" ></a></div>
and that image class $id I want to use in my jq code
    $(".$id").click(function(e) { 
    e.preventDefault(); 
    $.post("product_details.php", {
        makat : $('#makat').val()
    }, 
        function(data){
        }
    );
how is it possible to make it work?
 
     
     
    